DIV: integer division
Returns how many whole times b goes into a, discarding any remainder. DIV(10, 3) gives 3, but 10 / 3 gives 3.333. Both values are integers.
Understanding DIV: integer division in IGCSE Computer Science Paper 2
What it does: 5 goes into 17 three whole times, so this outputs 3 and the remainder 2 is ignored. The / operator keeps the fractional part, while DIV discards it and returns only the whole quotient. DIV(30, 4) returns 7 whole groups. 30 / 4 gives 7.5, which is not a whole number of groups. DIV never rounds. DIV(19, 10) is 1, not 2, because the fractional part .9 is simply thrown away. In Cambridge pseudocode, DIV is written as a function with brackets: DIV(a, b). Both values must be integers. Full teams must be whole numbers, so use DIV. The 2 players left over are found with MOD, not DIV.
Common mistakes: 10 / 3 gives 3.333, a REAL value, which cannot be stored in an INTEGER variable. DIV(10, 3) gives the whole number 3, so the line should be Groups ← DIV(10, 3). The arguments are the wrong way round. DIV(a, b) is how many times b goes into a. Here it should be DIV(50, BoxSize), which gives 8 boxes. The broken line gives 0.
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
DIV(a, b)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →