#include <iostream>
using namespace std;

int fact(int n){
    if(n==1)   // break condition
        return 1;
    return n*fact(n-1);
        }

int main() {
    int n;  //input
    cin>>n;
    cout<<fact(n);  //calling for printing factorial
}

Embed on website

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