logo

AQA A-Level Computer Science practice

Explain two differences between a variable and a constant in a programming language. Include one suitable example of each.

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

At a glance

Question

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

Explain two differences between a variable and a constant in a programming language. Include one suitable example of each.

Answer and explanation

Concise answer

A variable is a named value that may be changed while the program runs.

Why this is correct

The key distinction is whether the value is expected to change. The examples show a variable being assigned a new value and a C# constant being declared with the const keyword. A complete answer should explain both the changing nature of a variable and the fixed intended nature of a constant.

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

No flashcards are published for this page yet.

Related practice questions