Using DIV and MOD together (8.1c)
Use DIV and MOD on the same two numbers to split a value. DIV gives the whole units (2 hours) and MOD gives what is left over (30 minutes). Check: DIV * b + MOD gives a back.
Understanding Using DIV and MOD together (8.1c) in IGCSE Computer Science Paper 2
What it does: Whole units multiplied by the divisor, plus the remainder, always gives back the original number. An even number leaves a remainder of 0 when divided by 2, while an odd number leaves 1. MOD is the remainder. 150 minutes is 2 hours with 30 minutes left over, so MOD gives 30. Both calls must use the same two numbers in the same order. MOD(60, 150) gives 60, which is not the leftover minutes. Multiply the DIV result by 60 and add the MOD result. 3 * 60 + 20 = 200, so the split is correct. The leftover part of a split is found with MOD, so DIV here returns pounds rather than pence.
Common mistakes: The minutes left over are stored in Mins, but this line outputs Hours twice. It should be OUTPUT Hours, "h ", Mins, "m" so it shows 2h 30m. The arguments are the wrong way round. MOD(60, Total) gives 60 MOD 150 = 60, not the leftover minutes. It should be MOD(Total, 60), which gives 30.
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 429–438) and word search (Modules 419–438).
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
DIV(150, 60) and MOD(150, 60)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →