Ticker

6/recent/ticker-posts

Print numbers in reverse (From n to 1) Program





Print From n to 1 -

#include <stdio.h>

int main()
{ 
  int n,i;
  printf("Enter the number ");
  scanf("%d",&n); //Input the number from user
  for(i=n ; i>=1 ; i--) 
  { 
     printf("%d,",i);
  }  
return 0;
}

Output -

Enter the number 5
5,4,3,2,1,9

Post a Comment

0 Comments