C program to print natural numbers in reverse from n to 1 using for
#include<stdio.h>
int main()
{
int i,n;
/* Input limit from User */
printf("Enter any Number: ");
scanf("%d",&n);
/* Run loop from n to 1 and
decrement 1 in each iteration */
for(i=n;i>=1;i--)
{
printf("%d\n",i);
}
return 0;
}
Output
Enter any Number: 8
8
7
6
5
4
3
2
1