Question: Q3) Using the recursive factorial function from Lecture 5, write a program that calculates n choose r Firstly, prompt the user to enter two long

 Q3) Using the recursive factorial function from Lecture 5, write a

Q3) Using the recursive factorial function from Lecture 5, write a program that calculates "n choose r Firstly, prompt the user to enter two long long unsigned int numbers, n and r. Do this by printing the string, "Setting combination parameters, select n and r: ". To scanf a long long unsigned int use .%11u", use the same .%11u" for printing. The factorial function must be adjusted to return a long long unsigned int as well as accept a long long unsigned int as an argument. The program must make sure that n is less than 20, and that r is less than n. If either of those conditions are not met (n greater than 20 or r greater than n), print the string "Error: n is greater than 20 or r is greater than n. ". Follow the equation: 7l The combination calculation should be inside a function with the prototye long long unsigned int combination(long long unsigned int n, long long unsigned int r); The program should print the answer. A sample output is shown below Setting combination parameters, select n and r: 10 2 45 or Setting combination parameters, select n and r: 12 6 924 or Setting combination parameters, select n and r: 24 12 Error: n is greater than 20 or r is greater than n Note: There are still NO double spaces. Name your file combinations.c

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!