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
Answer and explanation
Concise answer
Only while the subroutine that declared it is executing
Why this is correct
A local variable is created for the execution of its subroutine and exists only during that execution.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
