📁 Topic 2 · 2.5 Operators
2.5 Arithmetic, relational and logical operators
Edexcel 4CP0 · iGCSE Computer Science · ~10 min read
Notes
──
Video
──
Slides
──
Worksheet
──
Quiz

Arithmetic Operators

Arithmetic operators perform mathematical calculations and always return a numeric result.

OperatorMeaningExampleResult
+Addition7 + 310
-Subtraction7 - 34
*Multiplication7 * 321
/Division (real result)7 / 23.5
DIVInteger division (quotient only, no remainder)7 DIV 23
MODModulo (remainder after integer division)7 MOD 21
SET total TO 17
SET groups TO total DIV 5 # 17 DIV 5 = 3 (full groups)
SET leftover TO total MOD 5 # 17 MOD 5 = 2 (remaining items)
SEND groups TO DISPLAY # 3
SEND leftover TO DISPLAY # 2

Relational Operators

Relational operators compare two values and return a Boolean result (TRUE or FALSE). They are used in conditions for IF and WHILE statements.

OperatorMeaningExampleResult
=Equal to5 = 5TRUE
<>Not equal to5 <> 3TRUE
<Less than3 < 7TRUE
>Greater than7 > 3TRUE
<=Less than or equal to5 <= 5TRUE
>=Greater than or equal to4 >= 6FALSE

Logical Operators

Logical operators combine Boolean conditions. Edexcel 4CP0 requires AND, OR, and NOT only.

OperatorMeaningReturns TRUE when…
ANDBoth conditions must be trueBoth left and right sides are TRUE
ORAt least one condition must be trueEither left or right (or both) is TRUE
NOTInverts the Boolean valueThe condition is FALSE (NOT TRUE = FALSE)
# AND example
IF age >= 16 AND hasID = TRUE THEN
SEND "Access granted" TO DISPLAY
END IF

# OR example
IF day = "Saturday" OR day = "Sunday" THEN
SEND "It's the weekend!" TO DISPLAY
END IF

# NOT example
IF NOT isRegistered THEN
SEND "Please register first" TO DISPLAY
END IF
📝 Exam Tip: MOD is used to check divisibility. If x MOD 2 = 0, then x is even. If x MOD 5 = 0, then x is a multiple of 5. This is a very common exam pattern.
⚠️ Common Mistakes
  • Confusing / and DIV — / gives a real result (e.g. 3.5), DIV gives the integer quotient only (e.g. 3)
  • Using = to assign in a condition — in pseudocode = means "equal to" in conditions, not assignment
  • Using NAND, NOR, or XOR — these are NOT in the Edexcel 4CP0 specification
← 2.4b File Handling Topic 2 · 2.5 Operators Next: 2.6 Sub-programs →
🔒
Pro Content
Subscribe to access all 47 Edexcel iGCSE lessons.
£7.99/month
or £59/year