Completing a full trace table for a dry run
A table for a dry run: follow the algorithm line by line with the given inputs, writing each variable, output and prompt in the order it happens, then check the final values.
Understanding Completing a full trace table for a dry run in IGCSE Computer Science Paper 2
What it does: A dry run of this loop tests Num MOD 2 = 0 on every pass, so Total only changes for Num = 2 and Num = 4, ending at 6. The last value written in the Total column is 6, and this is what the OUTPUT column shows at the end of the dry run. A dry run copies what the computer does. Each row is a step in the order of execution, so you can't finish one column and then start the next. Only the lines that really run create new values. If the condition is false, the THEN part is skipped (or the ELSE part runs instead).
Common mistakes: A FOR loop uses TO to set its end value: FOR Count ← 1 TO 3. Without the correct header you cannot work out the rows of a trace table. An IF condition must end with THEN. It should be IF N MOD 2 = 0 THEN, so you can trace which rows change Count.
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
trace tableFill in the Blanks
Spot the Error
Student with a class code? Join your class →