MOD: remainder (8.1a)
MOD(a, b) gives the remainder when integer a is divided by integer b, so MOD(10, 3) is 1. A result of 0 means exact division. MOD(n, 2) is 0 for even n and 1 for odd n.
Understanding MOD: remainder (8.1a) in IGCSE Computer Science Paper 2
What it does: Even numbers divide exactly by 2, so MOD(n, 2) is 0 for every even n. MOD(17, 5) gives the remainder 2, and the assignment arrow stores it in Left. 10 divided by 3 is 3 remainder 1. MOD gives the remainder, not the whole number part (that is DIV). 4 goes into 12 exactly 3 times with nothing left over, so the remainder is 0. 3 would be the DIV result. A remainder of 0 means exact division, for example MOD(15, 5) = 0. 7 divided by 2 is 3 remainder 1, so 7 is odd and MOD(7, 2) is 1.
Common mistakes: MOD(10, 3) gives the whole number 1, so Rem must be declared as INTEGER. A STRING variable cannot hold an integer remainder. It should be DECLARE Rem : INTEGER. In Cambridge pseudocode MOD is a function, not an operator placed between values. It should be Rem ← MOD(Num, 5), which gives 2.
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 337–346) and word search (Modules 337–357).
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
MOD(10, 3)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →