What is Pseudocode?
Pseudocode is a way of writing algorithms using English-like statements that are close to programming syntax but not tied to any specific language. It is easier to read than code but more precise than plain English. The Edexcel 4CP0 specification uses its own pseudocode notation which you must learn and use correctly in the exam.
Edexcel 4CP0 Pseudocode — Full Reference
Variables and Assignment
SET variableName TO value
SET total TO 0
SET name TO "Alice"
Input and Output
RECEIVE variableName FROM KEYBOARD
SEND "Hello" TO DISPLAY
SEND variableName TO DISPLAY
Selection — IF Statement
IF condition THEN
# statements if true
ELSE
# statements if false
END IF
The ELSE clause is optional. Nested IF statements are allowed.
Iteration — FOR Loop (count-controlled)
FOR count FROM 1 TO 10 DO
# statements repeated 10 times
END FOR
Iteration — WHILE Loop (condition-controlled)
WHILE condition DO
# statements repeated while condition is true
END WHILE
Iteration — REPEAT…TIMES Loop
REPEAT <expression> TIMES
// statements
END REPEAT
Procedures (no return value)
PROCEDURE procedureName(parameter1, parameter2)
BEGIN PROCEDURE
# statements
END PROCEDURE
# To call a procedure, write its name directly — no CALL keyword:
procedureName(value1, value2)
Functions (return a value)
FUNCTION functionName(parameter1)
BEGIN FUNCTION
# statements
RETURN result
END FUNCTION
# To call a function, use it in a SET statement:
SET answer TO functionName(value1)
Arithmetic Operators
| Operator | Meaning | Example |
| + | Addition | SET x TO a + b |
| - | Subtraction | SET x TO a - b |
| * | Multiplication | SET x TO a * b |
| / | Division | SET x TO a / b |
| DIV | Integer division (quotient) | SET x TO 17 DIV 5 → 3 |
| MOD | Modulo (remainder) | SET x TO 17 MOD 5 → 2 |
Complete Example
Algorithm to calculate the average of 5 numbers input by the user:
SET total TO 0
FOR count FROM 1 TO 5 DO
RECEIVE num FROM KEYBOARD
SET total TO total + num
END FOR
SET average TO total / 5
SEND average TO DISPLAY
📝 Exam Tip: Always use Edexcel's exact pseudocode keywords — SET/TO, RECEIVE/FROM KEYBOARD, SEND/TO DISPLAY. Using Python or other language syntax (e.g. input(), print()) in a pseudocode question will not gain marks.
⚠️ Common Mistakes
- Writing
SET x = 5 instead of SET x TO 5
- Writing
INPUT x instead of RECEIVE x FROM KEYBOARD
- Writing
PRINT x instead of SEND x TO DISPLAY
- Writing
NEXT count to close a FOR loop — Edexcel uses END FOR
- Writing
ENDWHILE (no space) to close a WHILE loop — Edexcel uses END WHILE (with space)
- Using
CALL procedureName() — Edexcel pseudocode has no CALL keyword; just write procedureName()
- Using
// for comments — Edexcel uses #
- Using
+ to join strings — Edexcel uses & for string concatenation