#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;
int i;
for(p=1,i=n-r+1;i<=n;p=p*i++);
cout<<n<<"P"<<r<<" = "<<p;
}
getch();
}
///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........