The RETURN statement
RETURN followed by a value or expression sends that value back to where the function was called, e.g. RETURN Number1 * Number1. It also ends the function.
Understanding The RETURN statement in IGCSE Computer Science Paper 2
What it does: RETURN Num * 2 is the last statement before ENDFUNCTION, and it sends the result back to the caller. RETURN is followed directly by a value or expression. The data type is given in the RETURNS part of the function header, not after RETURN. Once RETURN runs, control goes back to where the function was called. The returned value replaces the call, so it can be stored in a variable on the left of the assignment arrow.
Common mistakes: RETURN must be followed by a value or expression. A bare RETURN sends nothing back to the call. It should be RETURN Result. OUTPUT only displays the value. It does not send it back to where the function was called, so Sq(5) has no value. The line should be RETURN N * 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 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
RETURNFill in the Blanks
Spot the Error
Student with a class code? Join your class →