Print all natural numbers in reverse (from n to 1). using while loop with C
#include <stdio.h>
int main()
{
int N,i;
printf("Enter starting value: ");
scanf("%d", &N);
for (i = N; i >= 1; i--)
{
printf("%d ", i);
}
return 0;
}
Output:-
Enter starting value : 10
10 9 8 7 6 5 4 3 2 1
0 Comments