permutations

Calculate the number of arrangements of items in a specific order

int permutations(int n, int k);

will return the total number of possible arrangements of items in a specific order. There is no custom return type, the function always returns an integer.

permutations(4, 2); //12
permutations(5, 3); //60
permutations(6, 4); //360

Last updated