Counting in pseudocode
Adds 1 to Count each time an item meets a condition. Put it inside an IF in the loop, and set Count ← 0 before the loop starts so the count begins at zero.
Understanding Counting in pseudocode in IGCSE Computer Science Paper 2
What it does: The IF checks the condition for each item, so Count only goes up when the mark meets it. With no IF, the counter goes up on every pass, so it counts the loop passes (10) rather than the items that match a condition. A count starts at zero because nothing has been counted yet. Starting at 1 would make the final answer one too high. Assignment in IGCSE pseudocode uses the arrow ←. The = sign is for comparing values, not for storing them. The IF is true 4 times, so Count increases 4 times. The loop passes 10 times, but only the matches are counted.
Common mistakes: The IF statement is missing THEN. It should be IF Mark[Index] >= 50 THEN so the count is only increased when the condition is true. The counter must be set to 0 before the loop starts. Starting at 1 makes every final count one too high. It should be Count ← 0.
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 242–253) and word search (Modules 232–253).
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
Count ← Count + 1Fill in the Blanks
Spot the Error
Student with a class code? Join your class →