#include<iostream>
using namespace std;
int fact(int n);
int main()
{
    int n;
    cin>>n;
    cout<<fact(n)<<endl;
    return 0;
}
int fact(int n)
{
    if(n==0||n==1)
        return 1;
    else
        return n*fact(n-1);
}

Embed on website

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