← IGCSE Computer Science Paper 2

Cambridge pseudocode: keywords in capitals and indentation

Cambridge pseudocode writes keywords like INPUT, OUTPUT and IF in capital letters, puts one statement on each line, and indents the statements inside IF and loops.

Understanding Cambridge pseudocode: keywords in capitals and indentation in IGCSE Computer Science Paper 2

What it does: The keyword OUTPUT is in capitals, which is the Cambridge style for displaying a message. The OUTPUT line sits inside the FOR loop, so it is indented and has its own line. Cambridge pseudocode writes keywords such as INPUT in capital letters, so INPUT Age is correct. Statements inside an IF are indented so the structure is easy to see. The ENDIF lines up with the IF. Cambridge pseudocode puts each statement on its own line. This makes algorithms easier to read and check. Indentation shows which statements are inside a construct, so the algorithm is easier to read.

Common mistakes: Cambridge pseudocode keywords must be written in capital letters. 'input' should be INPUT. The keyword IF must be written in capitals. 'if' should be IF.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 123–134) and word search (Modules 123–145).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which line is written in correct Cambridge pseudocode style?
input AgeINPUT Age
Matches
input Name output Name
↓
The keywords INPUT and OUTPUT are written in lowercase; Cambridge pseudocode needs them in capital letters
Applying
Meanings
Term
KEYWORDS IN CAPITALS
Meaning
Cambridge pseudocode writes keywords like INPUT, OUTPUT and IF in capital letters, puts one statement on each line, and indents the statements inside IF and loops.
Practice
INPUT Mark
Testing
Gaps
Age
Check Answer
Spots
1OUTPUT "Enter your age"
2input Age

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Snowy Owl' badge — List Slicer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which line is written in correct Cambridge pseudocode style?
A. INPUT Age ✓
B. input Age
Cambridge pseudocode writes keywords such as INPUT in capital letters, so INPUT Age is correct.
2. Which line uses the keyword correctly?
A. OUTPUT "Welcome" ✓
B. output "Welcome"
OUTPUT is a keyword, so it must be written in capitals.
3. Which IF line follows Cambridge style?
A. IF Score > 50 THEN ✓
B. if Score > 50 then
The keywords IF and THEN are both written in capital letters.
4. Where should the statement OUTPUT "Pass" go inside an IF ... ENDIF?
A. At the left margin, level with IF
B. Indented on its own line between IF and ENDIF ✓
Statements inside an IF are indented so the structure is easy to see. The ENDIF lines up with the IF.
5. Which layout shows one statement per line?
A. INPUT Name OUTPUT Name
B. INPUT Name OUTPUT Name ✓
Cambridge pseudocode puts each statement on its own line. This makes algorithms easier to read and check.

Match the Pairs

INPUT Age → INPUT is a keyword written in capital letters; it reads a value from the user into the variable Age
IF Score >= 50 THEN OUTPUT "Pass" ENDIF → The statement inside the IF is indented, and IF, THEN, OUTPUT and ENDIF are all in capital letters
Keywords such as OUTPUT are written in capital letters in Cambridge pseudocode → OUTPUT "Hello"
Statements inside a loop are indented, with one statement on each line → FOR Count <- 1 TO 3 OUTPUT Count NEXT Count
input Name output Name → The keywords INPUT and OUTPUT are written in lowercase; Cambridge pseudocode needs them in capital letters
IF Age >= 18 THEN OUTPUT "Adult" ENDIF → The OUTPUT statement inside the IF is not indented, so the structure is hard to read

Key Term

KEYWORDS IN CAPITALS
Cambridge pseudocode writes keywords like INPUT, OUTPUT and IF in capital letters, puts one statement on each line, and indents the statements inside IF and loops.

Fill in the Blanks

1. INPUT Age OUTPUT Age
Hint: Type the capital-letter keyword that reads a value from the user into a variable.
2. INPUT Name OUTPUT Name
Hint: Type the capital-letter keyword that displays a value on the screen.
3. IF Mark >= 50 THEN OUTPUT "Pass" ENDIF
Hint: Type the capital-letter keyword that starts a decision.
4. IF Mark >= 50 THEN OUTPUT "Pass" ENDIF
Hint: Type the keyword that closes the decision, written at the same indent as the line that opened it.
5. FOR Count ← 1 TO 3 OUTPUT Count NEXT Count
Hint: Type the capital-letter keyword that ends a FOR loop, lined up with the FOR line.

Spot the Error

Question 1
A OUTPUT "Enter your age"
B input Age
C IF Age >= 18 THEN
D OUTPUT "Adult"
E ENDIF
Line B — Cambridge pseudocode keywords must be written in capital letters. 'input' should be INPUT.
Question 2
A INPUT Mark
B if Mark >= 50 THEN
C OUTPUT "Pass"
D ENDIF
Line B — The keyword IF must be written in capitals. 'if' should be IF.
Question 3
A INPUT Score
B IF Score > 90 THEN
C OUTPUT "Top"
D else
E OUTPUT "Keep going"
F ENDIF
Line D — ELSE is a keyword, so it must be in capital letters. 'else' should be ELSE.
Question 4
A Input Name
B OUTPUT "Hello " & Name
C OUTPUT "Welcome"
Line A — Keywords must be fully in capitals, not just start with a capital. 'Input' should be INPUT.
Question 5
A FOR Count ← 1 TO 3
B output "Hello"
C NEXT Count
Line B — OUTPUT is a keyword inside the FOR loop and must be in capital letters. 'output' should be OUTPUT.

Student with a class code? Join your class →