Writing a range condition precisely
A range check joins two comparisons with AND, so a value is valid only if both are true. Never chain them like 0 <= Mark <= 100. Use OR to test for values outside the range.
Understanding Writing a range condition precisely in IGCSE Computer Science Paper 2
What it does: Each limit gets its own full comparison with Age repeated, and AND joins them. This is the correct IGCSE pseudocode form. Exclusive limits use > and <, so 0 and 100 are rejected. Inclusive limits would use >= and <=. A range check is two separate comparisons joined by AND. Chaining like 0 <= Mark <= 100 is not allowed in IGCSE pseudocode. AND needs both comparisons to be true, so only ages from 11 to 16 pass. With OR, every number passes, because any number is at least 11 or at most 16. Outside the range means too low OR too high. No number can be below 0 and above 100 at the same time, so AND would never be true.
Common mistakes: A range check cannot be chained like 0 <= Mark <= 100. It must be two separate comparisons joined by AND: IF Mark >= 0 AND Mark <= 100. A mark cannot be below 0 and above 100 at the same time, so AND is never true. To test for values outside the range, use OR: IF Mark < 0 OR Mark > 100.
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
Mark >= 0 AND Mark <= 100Fill in the Blanks
Spot the Error
Student with a class code? Join your class →