logo

Cambridge IGCSE Computer Science practice

What happens to a global variable when a program ends?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

cambridge_mcq

Style

Topic

P rogramming concepts

Exam-style question

Try this first

What happens to a global variable when a program ends?.

  1. A.It is deleted
  2. B.It retains its value
  3. C.It is reset to zero
  4. 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.

Related flashcards

Flashcard 1 of 6

Press Space to flip, arrows to move

Related practice questions