Here, we will read the value of n and r from the user. Then we will calculate the nPr and print the result.
nPr:
The nPr is the permutation of arrangement of 'r' objects from a set of 'n' objects, into an order or sequence.
The formula to find permutation is: nPr = (n!) / (n-r)!
Program/Source Code:
The source code to calculate the value of nPr is given below. The given program is compiled and executed successfully.
Output:
Explanation:
Here, we read the value of n, r from the user. After that, we calculated the nPr and print the result.
need an explanation for this answer? contact us directly to get an explanation for this answer