← IGCSE Computer Science Paper 2

Assignment with the ← operator

Assignment: the value on the right of the arrow is stored in the variable on the left. Counter ← 0 stores 0 in Counter and replaces any earlier value.

Understanding Assignment with the ← operator in IGCSE Computer Science Paper 2

What it does: The arrow points left towards Total, which is the variable receiving the value 25. In maths Counter = Counter + 1 makes no sense, but as an assignment the right side is worked out first and then stored back in Counter. ← is an action. It stores a value in a variable. It does not state that two things are equal, as = does in an equation. The new value replaces the earlier one. It is not added to it, so Counter holds only 7. The data always flows from right to left, into the variable on the left. Assigning to a variable again overwrites its old value, so only the latest value 15 is kept.

Common mistakes: The arrow must point to the variable receiving the value. A value cannot be stored in 0. It should be Counter ← 0. Cambridge pseudocode uses the ← operator for assignment. The = sign is for comparing values. It should be Score ← 10.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 307–316) and word search (Modules 296–316).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which line stores the value 0 in the variable Counter?
Counter ← 00 ← Counter
Matches
0 ← Counter
↓
The arrow points the wrong way round: the value is on the left and the variable is on the right. A value cannot receive a value. It should be Counter ← 0.
Applying
Meanings
Term
Counter ← 0
Meaning
Assignment: the value on the right of the arrow is stored in the variable on the left. Counter ← 0 stores 0 in Counter and replaces any earlier value.
Practice
Counter ← 0
Testing
Gaps
Counter 0
Check Answer
Spots
1DECLARE Counter : INTEGER
20 ← Counter

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Abyssal Dragon' badge — Deep Sea Legend, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which line stores the value 0 in the variable Counter?
A. Counter ← 0 ✓
B. 0 ← Counter
The variable receiving the value goes on the left of the arrow and the value goes on the right.
2. In Counter ← 5, which way does the arrow point?
A. Towards 5, the value being stored
B. Towards Counter, the variable receiving the value ✓
The arrow points at the variable that receives the value.
3. True or false: Total ← 10 means 'Total is equal to 10', like an equation.
A. True: it states that Total equals 10
B. False: it stores 10 in Total ✓
← is an action. It stores a value in a variable. It does not state that two things are equal, as = does in an equation.
4. Counter ← 3 is followed by Counter ← 7. What is the value of Counter afterwards?
A. 7 ✓
B. 10
The new value replaces the earlier one. It is not added to it, so Counter holds only 7.
5. Which assignment is written correctly in Cambridge pseudocode?
A. Score ← 100 ✓
B. 100 ← Score
A value such as 100 cannot receive a value. Only a variable can go on the left of the arrow.

Match the Pairs

Counter ← 0 → Stores the value 0 in the variable Counter, so the counter starts at zero
Score ← 10 Score ← 15 → Score ends up holding 15, because the new value replaces the earlier value 10
The arrow points to the variable that receives the value, so the variable goes on the left → Total ← 25
The ← operator means 'store this value', it is not the same as = in a maths equation. It adds 1 to the old value, then stores the result → Counter ← Counter + 1
0 ← Counter → The arrow points the wrong way round: the value is on the left and the variable is on the right. A value cannot receive a value. It should be Counter ← 0.
Counter = 0 → Uses = instead of the ← assignment operator. Cambridge pseudocode stores a value with ←, so it should be Counter ← 0.

Key Term

Counter ← 0
Assignment: the value on the right of the arrow is stored in the variable on the left. Counter ← 0 stores 0 in Counter and replaces any earlier value.

Fill in the Blanks

1. Counter ← 0
Hint: Type the assignment operator that stores the value on its right in the variable on its left.
2. DECLARE Counter : INTEGER Counter ← 0
Hint: Type the name of the variable that receives the value, which goes on the left of the arrow.
3. Counter ← 0 Counter ← Counter + 1
Hint: Type the variable whose current value is read on the right side, so that 1 is added to it.
4. Score ← 5 Score ← 8 OUTPUT Score
Hint: Type the variable that is given a new value, which replaces its earlier value.
5. Total ← 0 Total ← Total + 10
Hint: Type the operator that stores the result of the expression back into the variable.

Spot the Error

Question 1
A DECLARE Counter : INTEGER
B 0 ← Counter
C Counter ← Counter + 1
D OUTPUT Counter
Line B — The arrow must point to the variable receiving the value. A value cannot be stored in 0. It should be Counter ← 0.
Question 2
A DECLARE Score : INTEGER
B Score = 10
C Score ← 15
D OUTPUT Score
Line B — Cambridge pseudocode uses the ← operator for assignment. The = sign is for comparing values. It should be Score ← 10.
Question 3
A Total == 0
B Total ← Total + 5
C OUTPUT Total
Line A — == is a comparison, not an assignment. It does not store 0 in Total. It should be Total ← 0.
Question 4
A DECLARE Lives : INTEGER
B Lives ← 3
C Lives - 1 ← Lives
D OUTPUT Lives
Line C — The variable receiving the value goes on the left of the arrow and the expression on the right. It should be Lives ← Lives - 1.
Question 5
A DECLARE Age : INTEGER
B Age ← 14
C OUTPUT Age
D Age := 15
E OUTPUT Age
Line D — Cambridge pseudocode does not use := for assignment. The ← operator replaces the earlier value 14 with 15. It should be Age ← 15.

Student with a class code? Join your class →