Suppose that we have n distinct objects. There are many different orders that we can select to line up the objects in a row. In fact, there are n! orderings, or permutations, that can be obtained with n objects. If we have n objects and select k of the objects, then there are n!/(n − k)! possible orderings of k objects. That is, the number of different permutations of n different objects taken k at a time is n!/(n − k)!. Write a function named permute that receives values for n and k, and then returns the number of permutations of the n objects taken k at a time. (If we consider the set of digits 1, 2, 3, the different permutations of two digits are 1, 2, 2, 1, 1, 3, 3, 1, 2, 3 and 3, 2.) Assume that the corresponding prototype is
int permute(int n; int k);
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.