IF ... THEN ... ELSE ... ENDIF (7c)
Gives the statements that run when the IF condition is FALSE. ELSE has no condition of its own, so exactly one of the two branches (THEN or ELSE) runs.
Understanding IF ... THEN ... ELSE ... ENDIF (7c) in IGCSE Computer Science Paper 2
What it does: The OR condition catches values below 0 or above 100 in the THEN branch. Every other value goes to the ELSE branch, so Correct becomes TRUE. ELSE has no condition of its own. It simply runs when the IF condition is FALSE. The whole IF statement must be closed with ENDIF, even when it has an ELSE. Assignment uses ←. The = sign is for comparison, so it is wrong here.
Common mistakes: Assignment in pseudocode uses the ← arrow. The = sign is used to compare values. It should be Correct ← FALSE. No number is both below 0 and above 100, so AND is always FALSE and the ELSE branch would always run. The condition needs OR.
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 156–165) and word search (Modules 146–165).
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
ELSEFill in the Blanks
Spot the Error
Student with a class code? Join your class →