Exam-style question
Try this first
Which of the following describes a local variable?.
- A.Accessible throughout the program
- B.Defined within a function or procedure
- C.Retains its value after execution
- D.Used to pass data between functions
Answer and explanation
Concise answer
Defined within a function or procedure
Why this is correct
Local variables are only accessible within the scope of the function or procedure they are defined in.
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.
