CS210 Lab: Recursion Postlab
Use the following function to answer Questions 1 and 2.
int Puzzle (int base, int limit)
if (base > limit)
if (base == limit)
return base* Puzzle(base+1, limit);
Answer for post lab
- Identify the following:
- the base case(s) of the function Puzzle
- the general (recursive) case(s) of the function
- Show what would be written by the following calls to the recursive
- cout << Puzzle(20,5);
- cout << Puzzle(3,6);
- cout << Puzzle(8,8);
Back to Recursion Lab click
Copyright: Department of Computer Science, University of Regina.