Question 8
Back to Exercise
Which statement about recursion in C is true?
- A All recursive calls share one set of local variables
- B Each call gets its own stack frame, so very deep recursion can overflow the stack Correct
- C C turns every recursion into a loop
- D A recursive function cannot return a value
Correct Answer: Option B
Every call has its own parameters and locals in a new stack frame. Too many nested calls – for example a missing base case – exhaust the stack. The standard does not guarantee tail-call optimisation.
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!