#include<iostream.h> #include<conio.h> long factorial(int); main() { clrscr(); int n; int r; int nr; int factorial_n; int factorial_r; int factorial_nr; long ncr; cout<<\"\\n Enter the value of n = \"; cin>>n; cout<<\"\\n Enter the value of r = \"; cin>>r; factorial_n=factorial(n); factorial_r=factorial(r); nr=n-r; factorial_nr=factorial(nr); ncr=factorial_n/(factorial_r*factorial_nr); cout<<\"\\n nCr = \"<<n<<\" C \"<<r<<\" = \"<<ncr<<endl; getch(); return 0; } //--------------------------- factorial(int) --------------------------// long factorial(int number) { long factorial=1; if(number==0 || number==1); else { for(int count=1;count<=number;count++) factorial=factorial*count; } return factorial; }