Sunday, January 20, 2019

C Program To Print First 10 Natural Numbers In Reverse Order


Print 10 Natural Numbers In reverse order:-
In this c program we will print first 10 natural numbers in reverse order by using for loop. Here we take a int type variable, name as num for counter. We initialize with 10 and decrement the value of num, break loop when reached 1 by giving condition num>=1.

   /*
      Program : 10 Natural Numbers In Reverse Order
      Filename : naturalNumberReverse.c
      IDE Used To Developed : CodeBlocks
      Developed By : Pavito Golui
   */
  #include<stdio.h>
  int main()
   {
      int num;
       for(num=10;num>=1;num--)
         {
             printf("%d \n",num);
         }
       return 0;
    }
 

Output :

  10
  9
  8
  7
  6
  5
  4
  3
  2
  1

0 comments:

Welcome to you in All Coding Help