C program to Print All Natural Numbers in Reverse From n to 1 Using For Loop
Q:- Write a C program to Print All Natural Numbers in Reverse From n to
1 Using
For Loop ?
Input
#include<stdio.h>
#include<conio.h>
main()
{
int i,num;
clrscr();
printf(“Enter a Limit of N=”);
scanf(“%d”,&num);
for(i=num;i>=1;i--)
{
printf(“%d\n”,i);
}
getch();
}
Output
Enter a
Limit of N = 5
5
4
3
2
1
Comments
Post a Comment