CS120
Lab #11

Due at the end of lab.

You will earn full points for this lab if you answer all questions. Do not be concerned if you got a "wrong" answer. Just answer all the questions and enjoy learning about the topic.

For this lab we will explore recursion. A function that calls itself is recursive. Sometimes it is easier or more elegant to solve a problem using recursion rather than iteration. A recursive function must contain a base case and a recursive case. The base case is what is used to determine when to terminate recursion. If the base case is omitted or is incorrect, a recursive function will call itself without terminating, and an aberrant situation such as a segmentation violation will result. The recursive case of a recursive function is used to continue the recursion and continue making progress toward the solution.

A program containing a recursive function is here. Review this code and answer the following questions. Record your answers in a file that you can submit in Canvas.

Turn in: Submit the file with your answers to Canvas.