top of page

C Program to find nCr using Recursion

C Program to find nCr:



#include<stdio.h>

#include<conio.h>

int fact(x)

{

int i, f=i;

for(i=1;i<=x;i++)

{

f=f*i;

}

return(f);

}

void main()

{

int n,r, A;

printf("Enter the no.: ");

scanf("%d%d", &n,&r));

A=fact(n)/fact(r)*fact(n-r);

printf(%d",A);

getch();

}

Output:

Enter the no.: 2 1

2



76 views0 comments

Recent Posts

See All

Q1. The signal is transmitted in an optical fibre? A. Due to total internal reflection B. Due to external reflection C. In straight line path D. None of Above Ans: A Q2. Wi-Fi stan

Q 1. The maximum motion of Data transmission in dial up connection is……….. A. 56 kbps B. 512kbps C. 32kbps D. 8kbps Ans: A Q2. Which provides very slow internet connection service?

bottom of page