Calling a function inside an expression
A function call is written inside an expression, with no CALL keyword. The returned value replaces the call, then the rest of the expression is worked out.
Understanding Calling a function inside an expression in IGCSE Computer Science Paper 2
What it does: The function name and its values are written directly in the expression on the right. There is no CALL keyword, which is only used for procedures. The call is replaced by 500, giving 500 + 1 = 501. The +1 is not added to the 10 or the 20. The function runs first and its returned value takes the place of the call. Then the + 1 is calculated.
Common mistakes: CALL is only used with procedures. A function is called by writing its name and brackets inside the expression, so it should be Total ← Sq(5) + 1. A function call inside an expression is not a complete statement. The value must be used, for example with OUTPUT or by storing it in a variable: OUTPUT Cost(Price, Tax) + 1.
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 409–418) and word search (Modules 399–418).
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
SumSquare(10, 20) + 1Fill in the Blanks
Spot the Error
Student with a class code? Join your class →