Tracing assignments and arithmetic
When tracing, work out the right side using the current values, then write the result in that variable's column. The old value is used first, then replaced by the new one.
Understanding Tracing assignments and arithmetic in IGCSE Computer Science Paper 2
What it does: The old value (4) is used on the right side, and the result (5) becomes the new value of Counter. Only the variable on the left of the arrow changes. Total becomes 27, while Value is only read and stays the same. Use the current value first: 4 + 1 = 5. The 5 replaces the 4 in the Counter column. Work out the right side with the current values: 10 + 7 = 17. Then store 17 in Total. Each run adds 1 to the current value: 0, then 1, then 2, then 3. 48 + 79: add the units, 8 + 9 = 17, write 7 and carry 1. Then 4 + 7 + 1 = 12. The answer is 127.
Common mistakes: The variable being assigned to must be on the left of the arrow. It should be Counter ← 0, so the trace table starts with Counter as 0. The program should output Total, which holds the running sum (8 after the trace). Value only holds the number that was added. It should be OUTPUT Total.
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 83–92) and word search (Modules 71–92).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
Counter ← Counter + 1Fill in the Blanks
Spot the Error
Student with a class code? Join your class →