//write A programme to print all natural number from n to 1 using while loop
#include "stdio.h"
int main ()
{
int n,i;
printf ("Enter the last number:\n ");
scanf ("%i",&n);
printf ("The series is :\n");
i=n;
while(i>=1){
printf ("%i\n",i);
i--;
}
return 0;
}
output output output output
Enter the last number:
10
The series is :
10
9
8
7
6
5
4
3
2
1
No comments:
Post a Comment