Simple C program to find factorial of a number. If you need help please feel free to ask
#include <stdio.h> main() {int fact,n; printf("enter a number\n"); scanf("%d",&n); for(fact=1;n>0;n--) fact=fact*n; printf("factorial of the number is %d\n",fact); }
#include <stdio.h> main() {int fact,n; printf("enter a number\n"); scanf("%d",&n); for(fact=1;n>0;n--) fact=fact*n; printf("factorial of the number is %d\n",fact); }
No comments:
Post a Comment