i) A Program That Read Two numbers (n,r) & Display nPr (Permutation).

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

void main()
{
    int n,r,i;
    long int f1,f2,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<=n-r;i++)
          f2=f2*i;
   
       p=f1/f2;
       printf("%dP%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.........