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 International AS Computer Science 9618 writes algorithms in pseudocode.
- Use the guide for exams in 2026. The guide for 2027, 2028 and 2029 uses the same syntax.
- Statements run from top to bottom. That order is sequence.
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.
OUTPUT shows a value
OUTPUTdisplays a value. Text goes in double quotes.- Each
OUTPUTstarts a new line. - Several values, separated by commas, print on one line.
OUTPUT "Hello, world!"
OUTPUT "You have ", 3, " lives left"
Watch out
- Keywords are capitals:
OUTPUT, notprint. - A comma keeps values on one line. A new
OUTPUTstarts the next line. - Joining two strings with
&is taught with the string functions.
Common mistakes
- Text needs quotes. A number does not:
OUTPUT 42. - Comments start with
//and run to the end of the line.
Now you try
- Type pseudocode in the box, then press Run.
- 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 You have , the number 3, then lives left.
Click Run to see the output here.