#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,i,x;
long int f1,f2,f3,p;
clrscr();
printf("Enter 1st number, n = ");
scanf("%d",&n);
printf("Enter 2nd number,r = ");
scanf("%d",&r);
if(n<=r)
printf("r must be less than n");
else
{
if(n-r<r)
x=n-r;
p=1;
for(i=1;i<=x;i++)
p=p*(n-i+1)/i;
printf("%dC%d = %ld",n,r,p);
}
getch();
}
///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........