Comments above a subroutine
Starts a comment. Put one on the line before a procedure or function to say what it does and what its parameters are. The computer ignores comments.
Understanding Comments above a subroutine in IGCSE Computer Science Paper 2
What it does: The // comment sits directly above the PROCEDURE line and states its purpose. Everything after // on the line is a comment, so it is ignored when the program runs. Comments are only for people reading the code. They never run and never print. A useful comment is specific. It says what the subroutine does and what the parameter is for. Comments must begin with // so that the computer ignores them.
Common mistakes: A short end-of-line comment must start with //. A single / is not a comment, so the computer tries to run 'doubled value' as code. It should be: OUTPUT D // doubled value. The line before the function has no // at the start, so the computer treats the words as code and gives an error. It should be: // Returns a random number.
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 429–438) and word search (Modules 419–438).
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 →