Write a program to find factorial.
Program:
#include<stdio.h>
main(){
int n,i,fact=1;
printf("Enter your value = ");
scanf("%d", &n);
for(i=1; i<=n; i++)
fact=fact*i;
printf("Factorial = %d",fact);
}
Program:
#include<stdio.h>
main(){
int n,i,fact=1;
printf("Enter your value = ");
scanf("%d", &n);
for(i=1; i<=n; i++)
fact=fact*i;
printf("Factorial = %d",fact);
}