i) A Program That Read Two numbers (n,r) & Display nCr (Combination).

#include<stdio.h>
#include<conio.h>

void main()
{
    int n,r,i;
    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
    {
       f1=1;
       for(i=1;i<=n;i++)
       f1=f1*i;

       f2=1;
       for(i=1;i<=r;i++)
       f2=f2*i;

       f3=1;
       for(i=1;i<=n-r;i++)
       f3=f3*i;

       p=f1/(f2*f3);
       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.........