Problem: Program to print natural numbers from N to 1.
Given a number, n, you need to print from n to 1. The below program uses for loop to print n to 1 numbers.
#include<stdio.h>
int main() {
int n;
scanf("%d",&n);
for(int i=n;i>=1;i--){
printf("%d\n",i);
}
return 0;
}
int main() {
int n;
scanf("%d",&n);
for(int i=n;i>=1;i--){
printf("%d\n",i);
}
return 0;
}