IF ... THEN ... ENDIF (7a)
Runs the statements between THEN and ENDIF only when the condition is TRUE. If the condition is FALSE, they are skipped. This form has no ELSE part.
Understanding IF ... THEN ... ENDIF (7a) in IGCSE Computer Science Paper 2
What it does: The condition and THEN are on the first line, and the indented OUTPUT line is the statement that runs only when the condition is TRUE. If Score is 100 or less, the assignment is skipped and Score stays the same. There is no ELSE part to run instead. If the condition is FALSE, the statements between THEN and ENDIF are skipped and the program carries on after ENDIF. Every IF must be closed with the single keyword ENDIF. This form has no ELSE clause, so nothing extra happens when the condition is FALSE.
Common mistakes: Cambridge pseudocode uses OUTPUT to display a message, not PRINT. The line should be OUTPUT "Adult". The keyword that closes an IF block is the single word ENDIF, not END IF. The line should be ENDIF.
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 37–46) and word search (Modules 27–46).
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
IF condition THEN ... ENDIFFill in the Blanks
Spot the Error
Student with a class code? Join your class →