factorial

Run Settings
LanguageC
Language Version
Run Command
//3. Write a C program to calculate the factorial of a given number. #include<stdio.h> main() { int n,fact=1,i; printf("enter a number"); scanf("%d",&n); i=n; while(n>0) { fact=fact*n; n=n-1; } printf("the factorial of given number %d is =%d\n",i,fact); }
Editor Settings
Theme
Key bindings
Full width
Lines