/* Program to find out the coefficient of polynomial using recursion */ /* Problem 9 */ #include #include int fact(int num) { if (num == 1) return 1; else return (num * fact(num - 1)); } main() { int n,r; float res; clrscr(); printf("Please enter the value for n : "); scanf("%d",&n); printf("Also enter the value of r : "); scanf("%d",&r); res = (float)fact(n)/(fact(r) * fact(n - r)); printf("\nThe coefficient of polynomial nCr is %.2f",res); printf("\n\nPress any key to exit..."); getch(); }