Multiple choice

A variable is a

  1. string that varies during program execution

  2. portion of memory to store a determined value

  3. number that is frequently required in a program

  4. fixed value

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A variable is a named portion of memory that stores a value that can change during program execution. The key aspects are: 1) It occupies memory space, 2) It holds a value, 3) The value can vary (hence "variable"). Option A is incorrect because variables are not strings themselves - they have names and store values. Option C describes constants, not variables. Option D describes constants/literals, which are fixed values.