C Program to find the factorial of the given number

#include<stdio.h>
int main()
{
    int n;
    printf("enter the number \n");
    scanf("%d",&n);
    int i,fact=1;
    for(i=n;i!=0;i--)
    {
        fact=fact*i;
    }
    printf("The factorial of %d is: %d",n,fact);
}

Output:

Comments