logo

Question detail

When does a local variable normally exist?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

When does a local variable normally exist?.

  1. A.Only while the subroutine that declared it is executing
  2. B.From the start of the program until the program ends
  3. C.Only when another subroutine uses it
  4. D.Permanently after its first assignment

Model answer

What a good answer should say

  • Only while the subroutine that declared it is executing

Explanation

Why this works

A local variable is created for the execution of its subroutine and exists only during that execution.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.