GCSE Pseudocode: A Practical Guide to the Exam Style
Learn the exact pseudocode conventions exam boards expect, with worked examples covering variables, loops, arrays and functions.
Pseudocode marks get thrown away every year for silly reasons: wrong assignment symbol, missing colons, sloppy indentation. This guide covers the conventions used in GCSE Computer Science exams (the style is closest to OCR and AQA's reference sheets) and shows you how to write pseudocode that actually earns marks rather than losing them to formatting nitpicks.
Assignment, comparison and output
The most common slip-up is confusing assignment with equality. Pseudocode uses <- or = for assignment depending on the board, so check your specification, but the logic stays the same either way.
score = 0
score = score + 10
OUTPUT score
For input and output, use INPUT and OUTPUT in capitals — examiners are looking for these exact keywords, not print() or console.log(). If you write Python-style syntax in a pseudocode question, some mark schemes will still accept it if the logic is right, but don't risk it. Stick to the taught convention.
Comparisons use == for equality in most board pseudocode, and !=, <, >, <=, >= as you'd expect. Don't use a single = for comparison — that's the classic C-style mistake that costs a mark in a IF statement.
Selection: IF, ELSE IF, ELSE
IF age < 13 THEN
OUTPUT "Child"
ELSE IF age < 18 THEN
OUTPUT "Teenager"
ELSE
OUTPUT "Adult"
ENDIF
Every IF needs a matching ENDIF (or ENDIF/END IF depending on spec — AQA tends to just close with indentation and no explicit end token in some versions, so check your board's reference sheet before the exam). Indent consistently: two or four spaces, doesn't matter which, but pick one and stay with it through the whole answer. Examiners read structure through indentation as much as through keywords.
Iteration: three loop types, three jobs
GCSE pseudocode expects you to know when to use each loop, not just how to write it.
Count-controlled — use FOR when you know exactly how many times to repeat:
FOR i = 1 TO 10
OUTPUT i * i
NEXT i
Condition-controlled, check-first — use WHILE when the loop might not run at all:
WHILE total < 100
total = total + 10
ENDWHILE
Condition-controlled, check-last — use REPEAT...UNTIL when the loop must run at least once, such as validating input:
REPEAT
INPUT password
UNTIL LEN(password) >= 8
A common exam trap: examiners ask you to spot why a WHILE loop never runs, or why a REPEAT loop runs one extra time. Trace through with actual values on paper before you answer — don't just read the code.
Arrays and 2D arrays
Arrays are almost always zero-indexed in exam pseudocode, matching Python conventions taught alongside it.
names = ["Alex", "Sam", "Jo"]
OUTPUT names[0]
FOR i = 0 TO LEN(names) - 1
OUTPUT names[i]
NEXT i
For 2D arrays, you'll see grid[row][col] notation and nested FOR loops:
FOR row = 0 TO 2
FOR col = 0 TO 2
OUTPUT grid[row][col]
NEXT col
NEXT row
Get the loop order right — rows outer, columns inner is standard, but read the question carefully because some mark schemes swap it deliberately to test whether you're actually tracing the logic.
Procedures and functions
Know the difference: a procedure does something and doesn't return a value, a function returns one.
PROCEDURE greet(name)
OUTPUT "Hello " + name
ENDPROCEDURE
FUNCTION square(n)
RETURN n * n
ENDFUNCTION
result = square(5)
greet("Priya")
Parameters are passed by value unless the question says otherwise. If you're asked to write a function, always include RETURN — a function without one is a mark lost even if the calculation inside is correct.
Tracing tables: your best exam weapon
When a question gives you pseudocode and asks for the output, don't guess — build a trace table. Columns for each variable, one row per loop iteration, filling in values as they change. It's slower than reading the code in your head but far more reliable, especially with nested loops or off-by-one errors in array bounds.
Practising this properly
Write pseudocode by hand before typing it — the exam has no autocomplete. Then convert a few of your own answers into real Python and run them; if the output matches what you predicted, your understanding is solid. If it doesn't, you've found exactly where your logic breaks.
For more structured practice with loops, arrays and functions in real code, check the Python and Computer Science segments on Korra Studio.
Written with AI assistance, reviewed and published by Michal Pilch (CISSP), Korra Studio.
This is one note from the Korra Studio knowledge base — the platform pairs every topic with 1-to-1 mentoring.
Get started freearrow_forward