OUTPUT and sequence
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
Pseudocode is the exam's language
- Cambridge exams write algorithms in pseudocode — not Python or Java.
- It reads like plain steps, run from top to bottom. This order is called sequence.
- Below, you can actually run the pseudocode you write.
OUTPUT "Wake up"
OUTPUT "Brush teeth"
OUTPUT "Go to school"
Explore
One line after another
Pseudocode runs top to bottom — each line after the one above it. This order is sequence.
OUTPUT shows text
OUTPUTdisplays a value on the screen.- Text goes in double quotes:
"Hello". - Each
OUTPUTstarts a new line.
OUTPUT "Hello, world!"
OUTPUT "IGCSE Computer Science"
OUTPUT can join items
- List several items after
OUTPUT, separated by commas. - They print side by side, with no gaps.
OUTPUT "Score: ", 42 // → Score: 42
Watch out
- Text needs double quotes; numbers do not (
OUTPUT 42is fine). - A comma joins items on one line; a new
OUTPUTstarts a new line.
Common mistakes
OUTPUTshows a value; statements run in the order written.- Use the exam's exact keywords (
OUTPUT, notprint).
Now you try
- Type pseudocode in the box, then press Run to see its output.
- Press Check answer to test it.
Use OUTPUT to print the word Hello.
Click Run to see the output here.
Print Red, Green and Blue, one per line, in that order.
Click Run to see the output here.
On one line, output Total: followed by the number 7, so it reads Total: 7. (Separate the two items with a comma.)
Click Run to see the output here.