Recursion/Programs/nCr.cpp
//recursive funtion to calculate the nCr of given n and r
recursive funtion to calculate the nCr of given n and r
recursive funtion to calculate the nCr of given n and r
int NCR(int n,int r)
{
if(n==r || r==0)
return 1;
return NCR(n-1,r-1)+NCR(n-1,r);
}
int NCR ( int n , int r ) { if ( n == r || r == 0 ) return 1 ; return NCR ( n - 1 , r - 1 ) + NCR ( n - 1 , r ) ; }
recursive funtion to calculate the nCr of given n and r
recursive funtion to calculate the nCr of given n and r