ii) 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 p=1;
       for(int i=1;i<=r;i++)
       p=p*(n-i+1)/i;

       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.........