Java program to find permutation and combination (nCr nPr)

In this tutorial, we will see java program to find permutation and combination.
Permutation is represented as nPr and Combination is represented as nCr.It is simple program which involves factorial of the numbers.

Here is formula to find permutation and combination (nCr nPr).

nPr = factorial(n) / factorial(n-r)
nCr = factorial(n)/(factorial(n-r) * factorial(r))

Output:

Enter Value of n : 8
Enter Value of r : 4
NCR is 70
NPR is 1680

Was this post helpful?

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *