diff --git a/nCr Combination cpp b/nCr Combination cpp new file mode 100644 index 0000000..c2ada52 --- /dev/null +++ b/nCr Combination cpp @@ -0,0 +1,26 @@ +#include +using namespace std; + +int fact(int n) +{ + long long int a=1; + for(int i=1;i<=n;i++) + { + a*=i; + } + return a; +} +int ncr(int n,int r) +{ + long long int q=fact(n)/fact(n-r)/fact(r); + return q; +} + +int main() +{ + cout<<"n and r Respectively"<>n>>r; + cout<