📁 Topic 1 · 1.1 Algorithms
1.1c Representing algorithms — pseudocode
Edexcel 4CP0 · iGCSE Computer Science · ~11 min read
Notes
──
Video
──
Slides
──
Worksheet
──
Quiz

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

OperatorMeaningExample
+AdditionSET x TO a + b
-SubtractionSET x TO a - b
*MultiplicationSET x TO a * b
/DivisionSET x TO a / b
DIVInteger division (quotient)SET x TO 17 DIV 5 → 3
MODModulo (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
← 1.1b Flowcharts Topic 1 · 1.1 Algorithms Next: 1.1d Trace Tables →
🔒
Pro Content
Subscribe to access all 47 Edexcel iGCSE lessons.
£7.99/month
or £59/year