#include<stdio.h>
main()
{
int n,r;
float ncr;
printf("Enter values of n and r\n"); ncr=recbicoff(n,r);
printf("Binomial coefficient of c(%d,%d) is %f",n
,r
,ncr
);
}
int recbicoff(int n,int r)
{
if(r>n)
{
printf("The value of n can't be less than r");
}
if(r==0||r==n)
{
return(1);
}
else
{
return(recbicoff(n-1,r-1)+recbicoff(n-1,r));
}
}
I2luY2x1ZGU8c3RkaW8uaD4KbWFpbigpCnsKaW50IG4scjsKZmxvYXQgbmNyOwpwcmludGYoIkVudGVyIHZhbHVlcyBvZiBuIGFuZCByXG4iKTsKc2NhbmYoIiVkJWQiLCZuLCZyKTsKbmNyPXJlY2JpY29mZihuLHIpOwpwcmludGYoIkJpbm9taWFsIGNvZWZmaWNpZW50IG9mIGMoJWQsJWQpIGlzICVmIixuLHIsbmNyKTsKCn0KaW50IHJlY2JpY29mZihpbnQgbixpbnQgcikKewppZihyPm4pCnsKcHJpbnRmKCJUaGUgdmFsdWUgb2YgbiBjYW4ndCBiZSBsZXNzIHRoYW4gciIpOwoKfQppZihyPT0wfHxyPT1uKQp7CnJldHVybigxKTsKfQplbHNlCnsKcmV0dXJuKHJlY2JpY29mZihuLTEsci0xKStyZWNiaWNvZmYobi0xLHIpKTsKfQp9