Defining a function with no parameters
Starts a function with no parameters: the name has no brackets, RETURNS gives the data type of the value sent back, and ENDFUNCTION closes the function.
Understanding Defining a function with no parameters in IGCSE Computer Science Paper 2
What it does: There are no parameters, so the name GetPi stands alone, followed directly by RETURNS REAL. The header names the function and its return type, RETURN sends back the REAL value 3.14, and ENDFUNCTION closes it. In Cambridge pseudocode a function with no parameters is written with no brackets after its name. Every FUNCTION must finish with ENDFUNCTION, just as a procedure finishes with ENDPROCEDURE.
Common mistakes: A function with no parameters is written without brackets after its name. It should be FUNCTION GetPi RETURNS REAL. The header must have the keyword RETURNS before the data type. It should be FUNCTION GetMax RETURNS INTEGER.
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
FUNCTION GetPi RETURNS REALFill in the Blanks
Spot the Error
Student with a class code? Join your class →