The factorial function is a mathematical formula with the exclamation mark “!” as its symbol. You must multiply all the integers and positives that occur between the number in the formula and the number 1 in the Factorial formula.

A for loop is a type of repetition control structure that allows us to design a loop that is run a set number of times. The loop allows us to complete a n number of steps in a single line.

```
//c program to find factorial of a number using for loop
#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