What is Pseudocode?
Pseudocode is a method of describing an algorithm in a structured way that is easier to read than a programming language, but more formal and precise than plain English. Think of it as a bridge between your ideas and actual code.
The word "pseudo" means "false" or "not real" โ so pseudocode is "false code." It looks like programming, it follows a logical structure like programming, but it doesn't run on a computer directly (unless you use a tool like PseudoStudio!).
Here is the simplest pseudocode program:
OUTPUT "Hello, World!"
One line. One instruction. Output a piece of text. Simple โ and that's the point.
Why is Pseudocode Used in Exams?
Computer Science exams like Cambridge IGCSE (0478), A-Level (9618), and IB Computer Science use pseudocode for a very important reason: fairness.
Students at different schools learn different programming languages โ some learn Python, others learn Java, others use Visual Basic. If exams required you to answer in a specific language, students who didn't learn that language would be at a disadvantage.
Pseudocode removes this unfairness. Everyone writes in the same structured "language" that is about logic, not syntax. The exam tests whether you can think algorithmically โ not whether you remember Python's print() function vs Java's System.out.println().
How to Write Pseudocode
Here are the 5 key rules for writing good pseudocode in Cambridge exams:
- Use UPPERCASE keywords. Keywords like OUTPUT, INPUT, DECLARE, IF, WHILE, FOR are always capitalised in Cambridge pseudocode.
- Use โ for assignment, not =. The assignment arrow (
โ) assigns a value to a variable. The equals sign=is for comparison only. - Declare all variables first using
DECLARE variableName : DataType. - Indent nested blocks. Everything inside a loop or IF statement should be indented by 4 spaces so it's clear what belongs where.
- Close your blocks. FOR loops end with
NEXT i. WHILE loops end withENDWHILE. IF blocks end withENDIF.
// Step 1: Declare variables DECLARE Score : INTEGER DECLARE Grade : STRING // Step 2: Get input OUTPUT "Enter your exam score:" INPUT Score // Step 3: Make a decision IF Score >= 70 THEN Grade โ "A" ELSE Grade โ "B or below" ENDIF // Step 4: Display output OUTPUT "Your grade is: ", Grade
Pseudocode vs Real Code
Let's compare the same algorithm written in pseudocode vs Python:
DECLARE i : INTEGER FOR i โ 1 TO 5 OUTPUT i * i NEXT i
for i in range(1, 6):
print(i * i)The logic is identical. The pseudocode version just makes the structure clearer and removes language-specific details like Python's range() function.
How to Run Pseudocode?
Normally, you can't run pseudocode because computers only understand real programming languages. But PseudoStudio has built a free online pseudocode compiler that executes Cambridge IGCSE and A-Level pseudocode directly.
This means you can write your pseudocode, press Run, and see actual output โ catching bugs and logic errors before your exam. It's like having a practice environment specifically built for Computer Science students.
Test Your First Pseudocode Now
Our free compiler supports the full Cambridge 0478 and 9618 pseudocode specification.
โถ Open Free Pseudocode CompilerLearn More
Now that you know what pseudocode is, dive into our detailed topic guides to master every part of the Cambridge syllabus: