Drawing a decision inside a loop in a flowchart
A diamond on the loop path is asked on every pass. Both its Yes and No branches rejoin, then go back to the loop test, usually after the counter update.
Understanding Drawing a decision inside a loop in a flowchart in Years 7–8 Creating Digital Solutions
What it does: Both paths meet at the same join point. From there one path goes to the counter update and back to the loop test. The diamond n > 3? sits inside the loop path. Each time the arrow returns to i <= 5?, the flow reaches the diamond again. Both branches must rejoin, or the loop would stop working on some passes. Even an empty No branch needs an arrow that rejoins the path. Put i <- i + 1 after the branches rejoin so it runs on every pass, whichever way the decision went.
Common mistakes: The No branch of the decision must not end the loop. Both Yes and No rejoin, then go to the counter update and back to the loop test. The line should end with No: skip, or show No rejoining. The counter update must happen after both branches rejoin. If only the Yes path adds 1 to i, the No path never changes i, so the loop never ends. It should say Yes and No: i <- i + 1.
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 3–47) and word search (Modules 3–125).
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
decision inside a loopFill in the Blanks
Spot the Error
Student with a class code? Join your class →