#include <iostream>
using namespace std;

int factoial(int n){
    int fact=1;

    for(int i=1;i<=n;i++){
        fact *=i;
    }
    return fact;
}

int nCr(int n,int r){
    int fact_n=factoial(n);
    int fact_r=factoial(r);
    int fact_nmr=factoial(n-r);

    return fact_n/(fact_r * fact_nmr);
}

int main() {
    int n=9 ,r=5;
    cout << nCr(n,r)  << endl;
    
    return 0;
}

Embed on website

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