Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Programming Fundamentals

The common arithmetic operators

All topicsPractise exam questions
Knowledge organiser

Programming Fundamentals

2.2.1e

+ - * / MOD DIV ^

What you need to know

Arithmetic operators are the basic mathematical operations used in programming to process numerical data. You need to know addition, subtraction, multiplication, division, exponentiation, integer division (DIV/quotient), and modulus (MOD/remainder). DIV and MOD are particularly useful in programming for tasks like checking odd/even numbers.

Key points

  • + Addition, - Subtraction, * Multiplication, / Division (returns a decimal).
  • MOD (% in Python) returns the remainder of a division, e.g. 7 MOD 2 = 1.
  • DIV (// in Python) returns the integer quotient of a division, e.g. 7 DIV 2 = 3.
  • ^ Exponentiation (** in Python) raises a number to a power, e.g. 12^2 = 144.
  • MOD is useful for checking if a number is even or odd: number MOD 2 == 0 means even, remainder 1 means odd.
  • DIV and MOD together are used for TIME CONVERSIONS: hours = totalMinutes DIV 60, mins = totalMinutes MOD 60.
  • Exam Tip:'Incrementing a variable' means score = score + 1 (or score += 1 or score++). Note: score =+1 is WRONG — it assigns positive 1, overwriting the value. Also: score + 1 alone does NOT change score.
  • Exam Tip:You may be asked to fill in the missing arithmetic operator, e.g. print(12 __ 2) for exponentiation → ^ or **.
  • Exam Tip:* means multiplication, / means division. DIV is integer/floor division (no remainder). You may be asked to state the PURPOSE of each operator.

Code examples

Arithmetic operators in Python
python
a = 17
b = 5

print(a + b)   # 22  (addition)
print(a - b)   # 12  (subtraction)
print(a * b)   # 85  (multiplication)
print(a / b)   # 3.4 (real division)
print(a // b)  # 3   (DIV / quotient)
print(a % b)   # 2   (MOD / remainder)
print(a ** 2)  # 289 (exponentiation)