← Quiz: Recursion and Stack Frames: all 10 questions
Quiz: Recursion and Stack Frames · Question 7 of 10
What usually happens when recursion has no reachable base case?
What usually happens when recursion has no reachable base case?
- A.The compiler adds one automatically
- B.The function returns 0
- C.Frames keep being pushed until the stack runs out — a stack overflow crash
- D.The program runs forever without using memory
Answer & explanation
Correct answer: Frames keep being pushed until the stack runs out — a stack overflow crash
Each call takes stack space, and the stack is limited.
Can you get the rest right without peeking?
Take the timed Quiz: Recursion and Stack Frames quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →