Write a program to display numbers from 1-n in reverse order

//this is a program to display numbers from 1-n in reverse order
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;

printf("\n\nEnter Any Number: ");
scanf("%d",&n);

printf("\n\nDisplaying Numbers from 1-%d in Reverse Order",n);
i=n;

while(i>=1)
{
printf("\n%d",i);
i--;
}
getch();
}

Previous
Next Post »