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

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

void main()
{
    int n,r;
    clrscr();
    cout<<"Enter 1st number, n = ";
    cin>>n;
    cout<<"Enter 2nd number,r = ";
    cin>>r;

    if(n<=r)
    printf("r must be less than n");
    else
    {
       long int f1=1;
       for(int i=1;i<=n;i++)
       f1=f1*i;

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

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

       long int p=f1/(f2*f3);
       cout<<n<<"C"<<r<<" = "<<p;
    }

    getch();
}

///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........