C program to find the factorial of a number using for loop

C program to find the factorial of a number using for loop beginners to understand basic concepts in factorial program. Factorial number program in c programming language. This program helps you to find the factorials number or not in c. The multiplication of the number is known as factorial number in c language to check the number is fact or not.

#include<stdio.h> 
int main() 
{ 
int i,fact=1,num; 
printf("Enter a num"); 
scanf("%d",&num); 
for(i=1;i<=num;i++)
{ 
fact=fact*i; 
} 
printf("%d",fact); 
return 0; 
}

Output

Enter a num 5

120