Branching with IF ... THEN
Runs the indented action only when the condition is true. If the condition is false, the action is skipped. Write IF and THEN in capitals, indent the action, and finish with END IF.
Understanding Branching with IF ... THEN in Years 5–6 Creating Digital Solutions
What it does: The indented line show "Well done!" sits inside the IF block, so it runs only when score > 10 is true. If the door is not open, 'walk through' is skipped. 'say hello' is outside the block, so it still runs. In our pseudocode, IF and THEN are written in capital letters so they stand out from the rest of the line. The action sits inside the branch, so we indent it. The indent shows which step belongs to the IF. END IF shows where the branch finishes. Steps after it happen no matter what the condition was. The condition sits between IF and THEN. It is the question that is either true or false. 'walk through' is the action.
Common mistakes: The IF line is missing THEN. It should be 'IF score > 10 THEN' so the computer knows the action comes next. An IF block must finish with END IF, not just END. The last line should be 'END IF'.
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 11–20) and word search (Modules 1–20).
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 action END IFFill in the Blanks
Spot the Error
Student with a class code? Join your class →