Relational operators compare two values and return a Boolean result (True or False). They are used in conditions for IF, WHILE, and REPEAT…UNTIL.
| 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 |
Boolean operators (logical operators) combine or negate Boolean values. AQA specifies AND, OR, and NOT.
| Operator | Meaning | Rule |
|---|---|---|
| AND | Both must be True | True AND True → True; anything else → False |
| OR | At least one True | False OR False → False; anything else → True |
| NOT | Reverses Boolean | NOT True → False; NOT False → True |
| A | B | A AND B | A OR B | NOT A |
|---|---|---|---|---|
| True | True | True | True | False |
| True | False | False | True | False |
| False | True | False | True | True |
| False | False | False | False | True |
When multiple operators appear together, the order matters: NOT → AND → OR (NOT has highest priority).
Use brackets to make complex conditions clear and unambiguous.
8 questions · 22 marks
| Term | Definition |
|---|
Timed exam conditions.