Global variables
A variable declared outside every subroutine, so the main program and any procedure or function can use and change it. It exists for the whole program.
Understanding Global variables in IGCSE Computer Science Paper 2
What it does: The function uses the global variable Score directly, without a parameter, because a global variable can be used in any subroutine. Global variables exist for the whole program. Local variables only exist while their subroutine runs.
Common mistakes: Assignment in IGCSE pseudocode uses the ← arrow, not =. The global variable Score should be set with Score ← 0. AddTen changes the global variable Total but returns nothing, so it is a procedure. The line should be PROCEDURE AddTen() to match ENDPROCEDURE.
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
global variableFill in the Blanks
Spot the Error
Student with a class code? Join your class →