Error: wrong relational operator
Using > instead of >= (or < instead of <=) is a logic error: the boundary value, such as Age 18, is wrongly rejected. Test the boundary value, then correct the operator.
Understanding Error: wrong relational operator in IGCSE Computer Science Paper 2
What it does: Mark >= 50 is true for 50, so the boundary value passes as the rule requires. Age <= 12 is true when Age is 12, whereas Age < 12 would wrongly reject a 12-year-old. 18 or over includes 18, so use >=. With > an 18-year-old is wrongly rejected. A mark of exactly 50 should pass, but Mark > 50 rejects it. The correct operator is >=. The code is valid, so it runs. It simply gives the wrong answer at the boundary value. Test the boundary value and the value next to it. 17 should fail and 18 should pass.
Common mistakes: Using > instead of >= wrongly rejects someone aged exactly 18, the boundary value. It should be IF Age >= 18 THEN. A mark of exactly 50 should pass, but > rejects it. Testing the boundary value 50 shows the error. It should be IF Mark >= 50 THEN.
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 232–241) and word search (Modules 232–253).
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
Age >= 18Fill in the Blanks
Spot the Error
Student with a class code? Join your class →