Exam-style question
Try this first
When does a local variable normally exist?.
- A.Only while the subroutine that declared it is executing
- B.From the start of the program until the program ends
- C.Only when another subroutine uses it
- D.Permanently after its first assignment
Model answer
What a good answer should say
- Only while the subroutine that declared it is executing
Explanation
Why this works
A local variable is created for the execution of its subroutine and exists only during that execution.
Common mistake
No common mistake is linked to this question yet.
