Java program to find permutation and combination (nCr nPr)

Previous
Next

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

Previous
Next

Join Our News Letter – Stay Updated

Subscribe to Awesome Java Content.




Add Comment

Join Our News Letter - Stay Updated

Subscribe to Awesome Java Content.
You can like our facebook page Java2blog