Question: Program 2 -n Choose r Save the following program as NChooseR. Zip up the folder to hand in. First, write a recursive function to
Program 2 -n Choose r Save the following program as NChooseR. Zip up the folder to hand in. First, write a recursive function to calculate n! (n factorial). Use this n! function to calculate the number of ways to choose r different objects from a set of n objects. Sample Application Output n! C(n,r)= r!(n-r)! Basic Application Example File Help n Choose r This program calculates the number of ways r different objects can be chosen from a set of n objects. Enter the number of objects to choose: Enter the number of objects there are to choose from: 2 9 Calculate the Number of Ways There are 36 ways.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
