Operators are the working parts of every expression. Arithmetic operators calculate, relational operators compare two values, and logical operators join conditions together. Learn exactly which ones the 0478 syllabus uses and how to evaluate them.
Arithmetic operators: + - * / ^ (raised to the power of), plus MOD and DIV. Relational operators: = < <= > >= and <> (not equal to); they compare two values and always give a BOOLEAN result. Logical operators: AND (TRUE only if both sides are TRUE), OR (TRUE if either side is TRUE) and NOT (reverses TRUE and FALSE). Powers are worked out first, then * and /, then + and -; brackets make the order explicit.
Work out each expression using the normal mathematical order: brackets, then powers, then multiplication and division, then addition and subtraction.
DECLARE Result : REAL Result ← 7 + 3 * 2 OUTPUT Result Result ← (7 + 3) * 2 OUTPUT Result Result ← 2 ^ 3 + 1 OUTPUT Result Result ← 7 / 2 OUTPUT Result
| Expression | Working | Result |
|---|---|---|
| 7 + 3 * 2 | 3 * 2 = 6 first, then 7 + 6 | 13 |
| (7 + 3) * 2 | brackets first: 10 * 2 | 20 |
| 2 ^ 3 + 1 | 2 ^ 3 = 8, then 8 + 1 | 9 |
| 7 / 2 | ordinary division | 3.5 |
| DIV(7, 2) and MOD(7, 2) | whole quotient and remainder | 3 and 1 |
The same idea in Python (for comparison only: the exam uses pseudocode)
print(7 + 3 * 2) # 13 print(2 ** 3 + 1) # 9: Python writes powers as ** print(7 / 2) # 3.5 print(7 // 2, 7 % 2) # 3 1: Python's DIV and MOD
Area ← 3.142 * 5 ^ 2./ gives the full answer, including any fractional part: 7 / 2 is 3.5. Use DIV only when you want the whole-number quotient, 3.
A relational operator compares two values. The answer is always TRUE or FALSE, which is why these expressions are used as conditions in IF statements and loops.
| Operator | Meaning | Example | Result |
|---|---|---|---|
| = | equal to | 5 = 5 | TRUE |
| < | less than | 8 < 3 | FALSE |
| <= | less than or equal to | 4 <= 4 | TRUE |
| > | greater than | 4 > 4 | FALSE |
| >= | greater than or equal to | 9 >= 2 | TRUE |
| <> | not equal to | 6 <> 7 | TRUE |
Score > 50, Score >= 50 and Score <> 49.Lives <= 0?In a condition, = compares; it does not store anything. Assignment always uses the arrow ←. (Python uses == to compare and != for not equal.)
Four quick checks. Each correct answer earns XP and records this skill on your profile.
What is the value of 2 + 3 * 4?
What data type is the result of a relational operation such as X > 5?
The lab's range check accepts ages from 11 to 18. Which input is rejected?
What is NOT (5 > 3)?
The lab's Range check program accepts an age from 11 to 18. Run it with the different kinds of test data and look at how OR rejects values and AND accepts them.
IF Age >= 11 AND Age <= 18
THEN
OUTPUT "Valid age"
ELSE
OUTPUT "Out of range"
ENDIF
| A | B | A AND B | A OR B | NOT A |
|---|---|---|---|---|
| FALSE | FALSE | FALSE | FALSE | TRUE |
| FALSE | TRUE | FALSE | TRUE | TRUE |
| TRUE | FALSE | FALSE | TRUE | FALSE |
| TRUE | TRUE | TRUE | TRUE | FALSE |
(Age < 12 OR Age > 65) AND Member = TRUE. Is there a discount for Age = 10 and Member = TRUE?Each side of AND or OR must be a complete comparison. Age > 11 AND < 18 is wrong; write Age > 11 AND Age < 18.
Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.
What is the value of 10 - 2 ^ 3?
Which condition is TRUE only when Temp is outside the range 15 to 25?
Which relational operator means not equal to?
A is 6 and B is 4. What is (A > 5 AND B > 5) OR A = 6?
This skill is now recorded on your profile. Keep the chain going.