Indentation and comments in pseudocode
Starts a comment in Cambridge pseudocode. Statements inside a loop or IF are indented four spaces, and ELSE lines up with its IF, so the structure is easy to read.
Understanding Indentation and comments in pseudocode in IGCSE Computer Science Paper 2
What it does: OUTPUT Count is the loop body and is indented four spaces, while FOR and NEXT stay at the left. Cambridge pseudocode starts a comment with //. The # symbol is used for comments in Python, not in Cambridge pseudocode. A comment needs two slashes, //. A single / is not a comment, so the line would cause an error. Everything after // is a comment. In the wrong answer the // comes first, so the assignment is turned into a comment and never runs. Indentation and comments help people read the algorithm. Comments are ignored when the algorithm is followed.
Common mistakes: A comment after a statement starts with //, not #. The line should be ' total <- total + n // add'. Cambridge pseudocode comments start with //. The /* ... */ style belongs to other languages. The line should be ' // count down by one'.
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 358–368) and word search (Modules 358–378).
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
//Fill in the Blanks
Spot the Error
Student with a class code? Join your class →