#include <stdio.h>
int fact(int m)
{
    if(m<=1)
    {
        return 1;
    }
    else 
    {
        return m*fact(m-1);
    }
}
int main()
{
    int k;
    printf("enter the number to find its factorial:\n");
    scanf("%d",&k);
    printf("the factorial of %d is %d",k,fact(k));
    return 0;
}

Embed on website

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