logo

Cambridge IGCSE Computer Science practice

Which of the following describes a local variable?

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

Which of the following describes a local variable?.

  1. A.Accessible throughout the program
  2. B.Defined within a function or procedure
  3. C.Retains its value after execution
  4. 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.

Related flashcards

Flashcard 1 of 6

Press Space to flip, arrows to move

Related practice questions