#include<stdio.h>
int fact(int num);
int main()
{
    int n,res;
    printf("enter any integer\n");
    scanf("%d",&n);
    res=fact(n);
    printf("factorial of %d is  %d\n",n,res);
    return 0;
    printf("factorial of %d is %d\n",n,res);
    return 0;
}
    int fact(int num)
{
if(num==0)
    return 1;
    else
    return(num*fact(num-1));
}

Embed on website

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