Where procedures and functions are defined
Write procedures and functions at the start of the code, before the main program. The main program comes after and holds the CALL statements and function calls that use them.
Understanding Where procedures and functions are defined in IGCSE Computer Science Paper 2
What it does: The procedure definition is at the top and the CALL statement is in the main program below it. Subroutines are defined first. The main program comes after and calls them. Procedures and functions are defined at the start of the code. Moving the CALL after ENDPROCEDURE fixes it.
Common mistakes: A procedure definition must finish with ENDPROCEDURE, not ENDFUNCTION. The definition is written first and then the main program calls it. CALL is only used for procedures. A function is called inside an expression or an OUTPUT statement, so the main program line should be OUTPUT Rate().
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
Define then callFill in the Blanks
Spot the Error
Student with a class code? Join your class →