Question 10
Back to Exercise
What happens when a recursive function never reaches a base case?
- A It returns 0
- B It keeps calling itself until the call stack overflows and the program crashes Correct
- C The compiler adds a base case
- D It loops quietly forever without using memory
Correct Answer: Option B
Every call uses a new stack frame, so unbounded recursion exhausts the stack (stack overflow).
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!