#include <stdio.h>
int fact(int);
main()
{
    int n,a;
    printf("\n  Find a Factorial Of Given Number  \n");
    printf("\n Enter a Number : ");
    scanf("%d",&n);
    printf("%d",n);
    a=fact(n);
    printf("\n Factorial Of Given Number %d is : %d ",n,a);
    printf("\n ------------------------------------- \n");
}
int fact(int x)
{
    int y;
    if(x==0 || x==1)
    {
        return 1;
    }
    else
    {
        y=x*fact(x-1);
        return y;
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: