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

#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;p=p*(n-i+1)/i;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.........