Syllabus: Cambridge Pseudocode
1.1 Free

What is pseudocode?

Describing an algorithm in structured, language-neutral steps.

An algorithm in plain steps

Pseudocode is a way of writing an algorithm that looks like a program but is not tied to any programming language. It lets you focus on the logic instead of the spelling rules of Python or Java.

A first example

Read two numbers and output the larger one.

INPUT a
INPUT b
IF a > b THEN
    OUTPUT a
ELSE
    OUTPUT b
ENDIF

Rules to remember

  • Keywords are written in capital letters: INPUT, OUTPUT, IF, THEN, ELSE, ENDIF.
  • Statements inside a block are indented.
  • Every IF has an ENDIF, every loop has its own end keyword.

Try it yourself

Write pseudocode that asks for a person's age and outputs "adult" if it is 18 or more, otherwise "child".