← IGCSE Computer Science Paper 2

DIV: whole-number quotient

Divides a by b and returns only the whole number part, discarding any remainder. DIV(10, 3) returns 3, so it counts how many whole groups of 3 fit into 10.

Understanding DIV: whole-number quotient in IGCSE Computer Science Paper 2

What it does: 30 divided by 4 is 7.5, so DIV(30, 4) gives 7 whole groups, which is stored in Groups. Dividing Minutes by 60 with DIV gives only the whole hours and ignores any leftover minutes. The remainder is what MOD returns. DIV returns how many whole times b fits into a. 10 does not fit into 7 even once, so the number of whole groups is 0. DIV never rounds up. DIV always discards the fractional part and never rounds. Rounding is done by ROUND. In this case DIV(17, 5) gives 3. DIV takes two arguments separated by a comma: DIV(200, 60), which gives 3. Writing 200 / 60 as a single argument is incorrect.

Common mistakes: DIV needs its two arguments separated by a comma. It should be DIV(135, 60), which returns 2. The variable declared and assigned is Groups, not Group. The line should be OUTPUT Groups so it shows 3.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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.

Learning
Duo
What does DIV(10, 3) return?
3.333
Matches
Result ← DIV(10, 3) OUTPUT Result // expects 3.33
↓
DIV does not return decimals. DIV(10, 3) returns 3, not 3.33, because the fractional part is discarded.
Applying
Meanings
Term
DIV(a, b)
Meaning
Divides a by b and returns only the whole number part, discarding any remainder. DIV(10, 3) returns 3, so it counts how many whole groups of 3 fit into 10.
Practice
minutes ← 130
Testing
Gaps
OUTPUT (10, 3)
Check Answer
Spots
1Hours ← DIV(135 60)
2OUTPUT Hours

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Golden Phoenix' badge — Savannah Legend, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does DIV(10, 3) return?
A. 3 ✓
B. 3.33
DIV discards the fractional part and keeps only the whole number. 10 divided by 3 is 3.33..., so DIV gives 3.
2. Which statement describes DIV(a, b) correctly?
A. Returns the whole-number part of a divided by b ✓
B. Returns the remainder of a divided by b
The remainder is what MOD returns. DIV returns how many whole times b fits into a.
3. A coach has 20 players and puts 6 in each team. Which expression gives the number of full teams?
A. DIV(20, 6) ✓
B. MOD(20, 6)
DIV(20, 6) returns 3, the number of whole groups of 6 that fit into 20. MOD(20, 6) would return 2, the players left over.
4. What does DIV(15, 5) return?
A. 0
B. 3 ✓
5 fits into 15 exactly 3 times, so DIV returns 3. A remainder of 0 is what MOD(15, 5) would give.
5. What does DIV(7, 10) return?
A. 1
B. 0 ✓
10 does not fit into 7 even once, so the number of whole groups is 0. DIV never rounds up.

Match the Pairs

DIV(10, 3) → Returns 3, because 3 whole groups of 3 fit into 10 and the remainder is discarded
DIV(125, 60) → Returns 2, the number of whole hours in 125 minutes
Store how many whole groups of 4 fit into 30 → Groups ← DIV(30, 4)
Output the whole hours in a number of minutes stored in Minutes → OUTPUT DIV(Minutes, 60)
Result ← DIV(10, 3) OUTPUT Result // expects 3.33 → DIV does not return decimals. DIV(10, 3) returns 3, not 3.33, because the fractional part is discarded.
Hours ← DIV(60, Minutes) → The arguments are in the wrong order. To find whole hours, the minutes must be divided by 60, so it should be DIV(Minutes, 60).

Key Term

DIV(a, b)
Divides a by b and returns only the whole number part, discarding any remainder. DIV(10, 3) returns 3, so it counts how many whole groups of 3 fit into 10.

Fill in the Blanks

1. OUTPUT DIV(10, 3)
Hint: Type the library routine that returns only the whole-number part of a division.
2. Hours ← DIV(150, 60)
Hint: Type the number of minutes in one hour, so the call converts minutes to whole hours.
3. DECLARE TotalMinutes : INTEGER Hours ← DIV(TotalMinutes, 60)
Hint: Type the variable declared on the first line that holds the minutes.
4. DECLARE Groups : INTEGER Groups ← DIV(17, 5)
Hint: Type the data type that suits a whole-number result with no fractional part.
5. DECLARE Groups : INTEGER Groups ← DIV(10, 3) OUTPUT Groups
Hint: Type the assignment symbol that stores the result of the call in the variable.

Spot the Error

Question 1
A Hours ← DIV(135 60)
B OUTPUT Hours
C OUTPUT "Whole hours"
Line A — DIV needs its two arguments separated by a comma. It should be DIV(135, 60), which returns 2.
Question 2
A DECLARE Groups : INTEGER
B Groups ← DIV(10, 3)
C OUTPUT "Groups of 3:"
D OUTPUT Group
Line D — The variable declared and assigned is Groups, not Group. The line should be OUTPUT Groups so it shows 3.
Question 3
A Total ← 17
B Size ← 5
C Boxes ← MOD(Total, Size)
D OUTPUT Boxes
Line C — MOD gives the remainder (2), not the number of whole groups. To count whole boxes use DIV(Total, Size), which returns 3.
Question 4
A Total ← 25
B Size ← 4
C OUTPUT "Full rows:"
D OUTPUT DIV(Size, Total)
Line D — The arguments are the wrong way round. DIV(4, 25) returns 0. It should be DIV(Total, Size), which returns 6.
Question 5
A Answer ← DIV 10, 3
B OUTPUT Answer
C // Output is 3
Line A — DIV is written like a function with brackets around its arguments. It should be Answer ← DIV(10, 3).

Student with a class code? Join your class →