Exam-style question
Try this first
What happens to a global variable when a program ends?.
- A.It is deleted
- B.It retains its value
- C.It is reset to zero
- D.It can be accessed by any function
Answer and explanation
Concise answer
It retains its value
Why this is correct
Global variables maintain their values until the program terminates, allowing them to be accessed throughout the program.
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.
