What is Pseudocode?
Pseudocode is a way of writing algorithms using structured, plain-English keywords. It's not a programming language — you can't run it on Python or Java. Instead, it's designed to describe logic clearly without worrying about the strict syntax rules of a real language.
Computer Science exams (like Cambridge IGCSE 0478, O-Level 2210, and A-Level 9618) use pseudocode to test whether you understand how algorithms work, not whether you can memorise Python syntax. That's why learning pseudocode is essential for exam success.
OUTPUT — Your First Pseudocode Statement
The simplest thing you can do in pseudocode is display text to the user. The keyword is OUTPUT:
OUTPUT "Hello, World!" OUTPUT "Welcome to pseudocode!"
This prints two lines of text. Try it in the editor — click "Open Editor" above, paste this code, and hit Run.
Variables — Storing Data
Variables hold values that your program uses. In Cambridge pseudocode, you must declare a variable with its type before using it:
DECLARE Name : STRING DECLARE Age : INTEGER Name ← "Alice" Age ← 16 OUTPUT "Name: ", Name OUTPUT "Age: ", Age
The five main data types are: INTEGER (whole numbers), REAL (decimals), STRING (text), BOOLEAN (TRUE/FALSE), and CHAR (single character).
INPUT — Getting User Data
Use INPUT to ask the user for information:
DECLARE UserName : STRING OUTPUT "What is your name?" INPUT UserName OUTPUT "Hello, ", UserName, "!"
When you run this in PseudoStudio, a terminal will pop up and wait for you to type your name.
IF Statements — Making Decisions
Use IF...THEN...ELSE...ENDIF to make your program choose between different actions:
DECLARE Score : INTEGER OUTPUT "Enter your score:" INPUT Score IF Score >= 50 THEN OUTPUT "You passed!" ELSE OUTPUT "Try again next time." ENDIF
The condition (Score >= 50) is checked. If TRUE, the first block runs. Otherwise, the ELSE block runs.
Loops — Repeating Actions
Loops let you repeat code. The FOR loop repeats a set number of times:
DECLARE i : INTEGER FOR i ← 1 TO 5 OUTPUT "Iteration: ", i NEXT i
This prints "Iteration: 1" through "Iteration: 5". There are also WHILE loops (check condition first) and REPEAT...UNTIL loops (check condition after). Learn more in the Loops Guide.
Arrays — Storing Multiple Values
Arrays hold multiple values under one name. Cambridge pseudocode uses 1-based indexing:
DECLARE Names : ARRAY[1:3] OF STRING DECLARE i : INTEGER Names[1] ← "Alice" Names[2] ← "Bob" Names[3] ← "Charlie" FOR i ← 1 TO 3 OUTPUT Names[i] NEXT i
This creates an array of 3 strings and prints each one. Learn more in the Arrays Guide.
What to Learn Next
You've covered the foundations! Here's your learning roadmap:
Loops Deep Dive
FOR, WHILE & REPEAT UNTIL — pre/post conditions, definite vs indefinite iteration
Read Guide →