0

597views

Write a Program to find the value of $Permutation^n$ Pr

**1 Answer**

0

597views

Write a Program to find the value of $Permutation^n$ Pr

0

0views

written 4.2 years ago by |

```
#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,npr;
int fact (int no);
clrscr();
printf("Enter the values of n and r:");
scanf("%d %d",&n,&r);
npr=fact(n)/fact(n-r);
printf("nPr=%d",npr);
getch();
}
int fact (int no)
{
int i,ans;
for(i=1,ans=1;i<=no;i++)
{
ans=ans*i;
}
return ans;
}
```

ADD COMMENT
EDIT

Please log in to add an answer.