➽ Program:-

#include<stdio.h> 

int main()   

{   

    int i, num, fact=1;   

    printf("Enter a number: ");   

    scanf("%d",&num);   

    for(i=1; i<=num; i++)

    {   

        fact = fact * i;   

    }   

    printf("Factorial of %d is %d", num, fact);   

    return 0; 

}

➽ Output:- 

Enter a number: 8
Factorial of 8 is 40320