Arithmetic and Relational Operators
Revise Arithmetic and Relational Operators for GCSE Computer Science with this free worksheet and full mark scheme — Foundation and Higher exam-style questions with worked answers for AQA GCSE Computer Science (8525). Arithmetic operators calculate values while relational operators compare them and return true or false.
Free downloads
These worksheets and mark schemes are original, written for Virtus Academy and checked against the current AQA specification. Every worksheet comes with a full mark scheme.
Topic overview
Arithmetic operators perform calculations, and relational operators compare two values to produce a Boolean result.
The arithmetic operators are addition, subtraction, multiplication, division, integer division, modulus and exponentiation. Integer division discards the remainder, so 17 DIV 5 gives 3. Modulus gives only the remainder, so 17 MOD 5 gives 2. These two are examined constantly and are the ones most often confused.
The relational operators are =, ≠, <, >, ≤ and ≥. Each compares two values and returns True or False, which is why they appear in IF statements and loop conditions. A single = tests equality in pseudocode, whereas ← performs assignment — mixing the two is a common error.
Revision notes
Arithmetic operators
Addition, subtraction, multiplication and division work as expected.
Integer division (DIV) discards the remainder: 17 DIV 5 = 3. Modulus (MOD) gives only the remainder: 17 MOD 5 = 2. Exponentiation raises to a power: 2 ^ 3 = 8.
Using DIV and MOD
DIV and MOD together split a division into its two parts.
17 divided by 5 is 3 remainder 2, so 17 DIV 5 = 3 and 17 MOD 5 = 2. MOD is commonly used to test divisibility: if n MOD 2 = 0 then n is even.
Relational operators
=, ≠, <, >, ≤ and ≥ compare two values and return True or False.
They appear in IF conditions and loop conditions. In pseudocode a single = tests equality, while ← performs assignment — using the wrong one is a frequent error.
Key points
- Arithmetic operators perform calculations.
- DIV gives the whole number part of a division.
- MOD gives the remainder.
- Relational operators compare two values.
- Relational operators return True or False.
- = tests equality, ← assigns a value.
Worked examples
Example 1
Work out 23 DIV 4 and 23 MOD 4. [2 marks]
Working
Example 2
Write a condition using MOD that is True when a number n is even. [2 marks]
Working
Example 3
State the result of 7 ≤ 7 and explain. [2 marks]
Working
Common mistakes
Confusing DIV and MOD.
DIV gives the whole part; MOD gives the remainder.
Using = for assignment in pseudocode.
Assignment uses ←; = tests equality.
Thinking ≤ excludes equality.
It means less than OR equal to.
Forgetting relational operators return a Boolean.
The result is True or False, not a number.
Exam tips
- Work out the division fully before splitting into DIV and MOD.
- Use MOD 2 = 0 to test for even numbers.
- Keep = and ← clearly distinct.
- Remember relational operators produce Booleans.
Key terms
- DIV
- Integer division, giving the whole number part.
- MOD
- Modulus, giving the remainder.
- Relational operator
- An operator comparing two values.
- Boolean result
- True or False, produced by a comparison.
Related topics
Written and reviewed against the current AQA specification. Spotted an error? Let us know.