Saturday, May 13, 2023

write A programme to print all natural number from n to 1 using while loop

//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

print a multiplication table of any integer taking from user

 // print a multiplication table of any integer taking from user  #include "stdio.h" int main () { int n,mul,i; printf ("...