int main()
{
int n,r,ncr;
printf("Enter any two numbers-->");
scanf("%d",&n,&r);
ncr=fact(n)/(fact(r)*fact(n-r));
printf("The NCR factor of %d and %d is %d",n,r,ncr);
return 0;
}
int fact (int n)
{
int i=1;
while(n!=0)
{
i=i*n;
n--;
}
return i;
}
Solved C Programs,C tutorial for beginners,Create simple software using "C" language,History of C programming language,Computer tips and tricks,blog,Create virus program etc.
C-PROGRAMMING © 2011 DheTemplate.com. Supported by Tips for Life and Blogging Tips