Arithmetic operators perform mathematical calculations and always return a numeric result.
| Operator | Meaning | Example | Result |
|---|---|---|---|
| + | Addition | 7 + 3 | 10 |
| - | Subtraction | 7 - 3 | 4 |
| * | Multiplication | 7 * 3 | 21 |
| / | Division (real result) | 7 / 2 | 3.5 |
| DIV | Integer division (quotient only, no remainder) | 7 DIV 2 | 3 |
| MOD | Modulo (remainder after integer division) | 7 MOD 2 | 1 |
Relational operators compare two values and return a Boolean result (TRUE or FALSE). They are used in conditions for IF and WHILE statements.
| Operator | Meaning | Example | Result |
|---|---|---|---|
| = | Equal to | 5 = 5 | TRUE |
| <> | Not equal to | 5 <> 3 | TRUE |
| < | Less than | 3 < 7 | TRUE |
| > | Greater than | 7 > 3 | TRUE |
| <= | Less than or equal to | 5 <= 5 | TRUE |
| >= | Greater than or equal to | 4 >= 6 | FALSE |
Logical operators combine Boolean conditions. Edexcel 4CP0 requires AND, OR, and NOT only.
| Operator | Meaning | Returns TRUE when… |
|---|---|---|
| AND | Both conditions must be true | Both left and right sides are TRUE |
| OR | At least one condition must be true | Either left or right (or both) is TRUE |
| NOT | Inverts the Boolean value | The condition is FALSE (NOT TRUE = FALSE) |