Question: The following is a pseudocode algorithm for a recursive function that returns the factorial of a non-negative integer n. The algorithm works for most
The following is a pseudocode algorithm for a recursive function that returns the factorial of a non-negative integer n. The algorithm works for most input but is missing out on one edge case. FUNCTION Factorial (n) if n = 1 else result 1 result = n* Factorial (n-1) Task 2.1 Write program code for this algorithm including the amendment you would make to: make the function works for all cases adhere to good programming style Verify that your program works by testing it for suitable values of n
Step by Step Solution
There are 3 Steps involved in it
Task 21 Recursive Factorial Function Heres the modified program ... View full answer
Get step-by-step solutions from verified subject matter experts
