Logic error versus syntax error
A mistake in an algorithm's steps. It still runs to the end with no warning, but gives the wrong output. Only tracing or testing shows it, unlike a syntax error that breaks the writing rules.
Understanding Logic error versus syntax error in ACARA Digital Technologies Years 7–8
What it does: Every line is written correctly and the algorithm finishes, but the output is wrong, so it is a logic error. The flowchart can still be followed to the end, but students who pass get the wrong message. The steps are wrong, not the shapes. The wrong relational operator does not break any writing rules, so only testing a boundary value reveals the wrong output.
Common mistakes: This is a logic error. The total should start at 0. Starting at 10 means the program still runs to the end with no warning, but the output is always 10 too high. A trace table would show it. This is a logic error. Using > instead of >= means a 13 year old gets no output. The program runs with no warning but gives the wrong result. Testing with the value 13 reveals it.
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 420–481) and word search (Modules 420–519).
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
logic errorFill in the Blanks
Spot the Error
Student with a class code? Join your class →