Revise Computing
Revision notesQuestionsFor schools
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Supplementary programming practice/Arithmetic Operators

DIV and MOD

301.2 Arithmetic Operators

Practise exam questions

Arithmetic Operators — Note 2 of 4

Use integer division & remainder.

What you need to know

DIV (//) gives the whole-number result of a division, throwing away the remainder. MOD (%) gives just the remainder. Together they are useful for time conversions and digit extraction.

What to know

  • // is integer division (DIV): 17 // 5 → 3
  • % is modulo (MOD): 17 % 5 → 2
  • Useful for converting units, e.g. minutes to hours
  • MOD by 2 checks odd/even: n % 2 == 0 means even

Code examples

DIV and MOD
python
minutes = 135
hours = minutes // 60    # 2
leftover = minutes % 60  # 15
print(hours, "h", leftover, "m")
← Previous noteArithmetic operators301.2 Arithmetic OperatorsNext note →Exponentiation301.2 Arithmetic Operators

Back to Arithmetic Operators

Specification notes for programming are in Paper 2.

Arithmetic Operators

Note 2 of 4

  1. 1Arithmetic operators
  2. 2DIV and MOD
  3. 3Exponentiation
  4. 4Operator precedence
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).