
/*C program to demonstrate the working of while loop*/

#include <stdio.h>
int main(){
int number,factorial;
printf("Enter a number.\n");
scanf("%d",&number);
factorial=1;
while (number>0){ /* while loop continues util test condition number>0 is true
*/
factorial=factorial*number;
--number;
}
printf("Factorial=%d",factorial);
return 0;
}
Describe what you're looking for in as much detail as you'd like.
Our AI reads your request and finds the best matching books for you.
Popular searches:
Join 2 million readers and get unlimited free ebooks