Common mistakes when calling procedures and functions
A common error when SumSquare is a function. CALL is only for procedures. A function returns a value, so use it in an expression, in OUTPUT, or store it in a variable.
Understanding Common mistakes when calling procedures and functions in IGCSE Computer Science Paper 2
What it does: The function returns a value but nothing uses it. It should be output, stored in a variable or used in an expression. Only functions return values. A procedure used inside an expression is an error. A procedure gives nothing back, so it cannot be added to 10. CALL ShowScore() is the correct way to run it. Each subroutine needs its matching end. FUNCTION ends with ENDFUNCTION and PROCEDURE ends with ENDPROCEDURE. Missing it is a common error. The function definition is not closed. Adding ENDFUNCTION after the RETURN line marks the end of the function.
Common mistakes: Sq is a function, and CALL is only for procedures. A function returns a value, so its result must be stored or used. The line should be R ← Sq(5). A function call alone on a line throws away the value it returns, so nothing is shown. The result must be used, for example OUTPUT Sq(N).
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 419–428) 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
CALL SumSquare(2, 3)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →