TEZPUR 2025 — Computer PYQ
TEZPUR | Computer | 2025Identify the variables in the following list: ‘x’, “x”, x, 5.
Choose the correct answer:
- A.
‘x’, “x”, x
- B.
‘x’, “x”
- C.
‘x’, x
- D.
x
(Correct Answer)
x
Explanation
The correct answer is (d) x.
In computer programming, a variable is a symbolic name (an identifier) that references a specific location in memory used to store data. In contrast, items enclosed in quotes are treated as literal strings, and numbers are treated as literal integers.
x: This is a valid identifier (variable name). It can be assigned a value, such as x=10.'x'and"x": These are string literals. They represent the character 'x' itself, not a storage location.5: This is an integer literal. It represents the value five directly.
We can illustrate the distinction through an assignment operation in a programming context:
VariableAssignment:x=5
In this equation, x acts as the memory reference, while 5 is the value being stored. If we attempt to treat a literal as a variable, the logic fails:
′x′=5⟹Invalid (Syntax Error)
Since only x functions as an identifier that can hold varying data, it is the only variable in the provided list.
