← Quiz: C Functions and Recursion: all 10 questions
Quiz: C Functions and Recursion · Question 10 of 10
How long does an ordinary (auto) local variable exist?
How long does an ordinary (auto) local variable exist?
- A.Until the program ends
- B.Only while its function or block is running
- C.Until it is printed
- D.For as long as the file is open
Answer & explanation
Correct answer: Only while its function or block is running
Local variables live on the stack and disappear when the function returns; static locals are the exception.
Can you get the rest right without peeking?
Take the timed Quiz: C Functions and Recursion quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →