top of page

C Program to find nCr using Recursion

Aug 16, 2022
1 min read

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



 
 
 

Recent Posts

See All
Web Designing Solved Paper July 2026

1. निम्नलिखित में से कौन से सी.एस.एस. नियम गलत हैं ? 1. मार्जिन किसी एलिमेंट के बॉर्डर के अंदर स्पेस जोड़ता है। 2. पैडिंग एलिमेंट के बॉर्डर के बाहर स्पेस जोड़ता है। 3. मार्जिन : ऑटो का उपयोग ब्लॉक एलि

 
 
 
Python July 2026 Exam Paper

1. निम्नलिखित में से किस प्रॉब्लम में पुनरावृत्ति प्रक्रिया की आवश्यकता होती है ? a. फैक्टोरियल गणना b. संख्याओं का योग c. डेसिमल को बाइनरी में बदलना d. दो वेरिएबलों का आदान-प्रदान (A) केवल a, b, c

 
 
 

1 Comment


2v2.io creates opportunities for memorable team battles by combining rapid combat with the ability to build protective structures and adjust strategies according to the changing battlefield.

Like
bottom of page