GCSE · Computer Science · AQA · Spec 8525
Integer division and remainder
135 minutes is 2 hours 15 minutes. You just got two answers from one division, and a program needs a different operator for each.
Computer Science · Algorithms
Trace table — dry run the code
135 minutes: how many hours and minutes is that? Predict each new value before you press Next.
Ready when you are — step through one line at a time.
Same idea, different symbols
Which operation is it?
Which operation does each operator do? (Each example uses 22 and 4.)
Still to sort
Integer division (0)
How many whole times the second number fits into the first.
Where the line is: Integer division and remainder come from the same division, but integer division counts the whole groups while remainder counts what's left.
Remainder (0)
What's left over after the whole groups are taken away.
Real division (0)
Ordinary division that keeps the fractional part.
Where the line is: Real division gives 5.5; integer division gives just the whole 5 and drops the .5.
Pseudo-code and Python write these operations differently. Sort each operator by what it actually returns.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
One division, two whole-number answers: how many times it fits, and what's left over.
What you need to know
- Predict what DIV, MOD and / return for a given pair of whole numbers.
- Work out a remainder by taking away divisor × quotient, never by reading the decimal.
- Handle the two special cases: exact division and a first number smaller than the second.
- Recognise DIV/MOD in pseudo-code and // and % in Python.
- Use DIV and MOD in a program to convert units and to test for even numbers and multiples.
The big picture
Integer division (DIV, or // in Python) gives the whole number of times one number fits into another, throwing any fraction away. The remainder (MOD, or % in Python) gives what's left over. They're different from real division (/), which keeps the fraction, and together they satisfy a = b × (a DIV b) + (a MOD b). Programs use them to split quantities into bigger and smaller units and to test whether numbers divide exactly.
Key points
Worked example
Problem
A program packs 75 eggs into boxes of 6. Write the two lines that store the number of full boxes and the number of eggs left over, and give their values.
⚠ Watch out
Reading the remainder off a calculator. 14 / 4 = 3.5, but 14 MOD 4 isn't 5: four fours make 12, so the remainder is 14 − 12 = 2.
Memory hook
DIV counts the full boxes. MOD counts what's still in your hands.
Check yourself
Without a calculator, work out 44 DIV 7, 44 MOD 7, 5 DIV 12 and 5 MOD 12. Then check each pair with divisor × DIV answer + MOD answer.
Flashcards
(12)What does a DIV b give?
What does a MOD b give?
7 / 2 compared with 7 DIV 2?
Why is 19 DIV 5 equal to 3, not 4?
23 / 4 = 5.75. So is 23 MOD 4 equal to 75?
How are a, b, a DIV b and a MOD b linked?
What is a MOD b when b divides a exactly?
If a is smaller than b, what are a DIV b and a MOD b?
Python symbols for integer division and remainder?
What does a single / do in pseudo-code and Python?
How can a program test whether n is even?
How can a program test whether n is a multiple of k?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore AQA GCSE Computer Science topics
How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 30 September 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.