AQA · GCSE · Computer Science
Course version: 8525 · Version from Sept 2020
Arithmetic operations in a programming language: subtraction
Subtraction is the arithmetic operator that finds the difference between two numeric values by taking the second away from the first.
Checked against the AQA 8525 specification (opens in a new tab) on .
- Point 3 of 8
Study notes
From the checked teaching notes for this specification point.
The idea
Subtraction is the arithmetic operator that finds the difference between two numeric values by taking the second away from the first. In a programming language it is written with the minus symbol, for example change ← paid − cost, where the value stored in cost is subtracted from the value stored in paid and the result is assigned to change. Learners must recognise that the order of the operands matters: 10 − 4 gives 6, but 4 − 10 gives −6, so swapping the operands changes the result and its sign. They should be able to read a short line of code, identify which value is being subtracted from which, and state the resulting value, including where operands are variables, constants or literal numbers. Learners should also check data types and handle negative results correctly.
What earns the marks
- Identifies the minus symbol as the operator that performs subtraction in a program.
- States that subtraction takes the second operand away from the first to give a difference.
- Evaluates a short expression such as 10 − 4 and gives the correct result of 6.
- Explains that the order of operands matters, so 4 − 10 gives −6 rather than 6.
- Recognises that the result of a subtraction can be assigned to a variable, including a negative value.
Common mistakes and how to put them right
Reversing the operands: learners may subtract the first value from the second.
Put it right: Subtract the right-hand operand from the left-hand operand as written.
Treating a negative result as an error.
Put it right: Accept negative results and keep the minus sign.
Adding instead of subtracting when the minus sign is close to a variable.
Put it right: Read the operator carefully and confirm it is subtraction.
Exam tips
- Write the value of each operand above the expression before calculating.
- Keep the order left to right and show the substitution, for example 10 − 4 = 6.
- Check whether the answer should be negative and include the sign if so.
Try the lesson
The start of the Arithmetic operations in a programming language: subtraction lesson, made from checked teaching notes for this specification point.
Have a go first
A program stores the integer 20 in a variable called stock and then executes stock = stock - 8. What value does stock hold afterwards?
There is more to this lesson
The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge
Test your understanding of Arithmetic operations in a programming language: subtraction
Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge