Comments with // (8.1a)
Starts a comment. Everything after // on that line explains the code to people and is ignored when the program runs, so it never changes what the program does.
Understanding Comments with // (8.1a) in IGCSE Computer Science Paper 2
What it does: Cambridge pseudocode has no block comment, so each line of a longer comment must begin with //. The comment after // is ignored, so X is still assigned 10 and OUTPUT X displays 10. Comments are written for people to read. The computer ignores everything after // on that line. Comments explain the code but are not run, so adding or removing them never changes the program's behaviour. An end-of-line comment needs // after the code. Without //, the words 'cost of 3 items' would be treated as code and cause an error. The broken line uses / (division) instead of // so the explanation is not a comment. It should be: Score ← 0 // set score to zero.
Common mistakes: Cambridge pseudocode comments start with //, not #. The line should be Score ← 0 // start at zero. A comment needs two forward slashes. A single / is not a comment, so the words would be read as code. It should be // Ask for the user's name.
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 347–357) and word search (Modules 337–357).
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 →