/* Write a program to find Number of Combination using Mathematical formula C(n , r) */
#include<stdio.h>
#include<conio.h>
void main()
{
int fact(int);
int ncr ;
long n , r ;
printf("\n Enter the value of n & r ");
scanf("%d%d",&n,&r);
ncr = fact(n)/( fact(r)*fact(n-r)) ;
printf("\n The nCr = %d ",ncr);
getch();
}
int fact(int n)
{
int i;
long facto = 1;
for(i=1; i <= n ;i++)
{
facto = facto*i ;
}
return(facto);
}
Hello
This website is a special gift for Programming Lovers , which want to learn basic Programming Languages and want to develop there skills Read More....
This email address is being protected from spambots. You need JavaScript enabled to view it.