# Pseudocode in Examined Components

> Cambridge Assessment International Education (CAIE) Pseudocode Reference Guide
> Applicable Syllabus: **IGCSE &amp; A Level**

Cambridge pseudocode formatting conventions: font, indentation, uppercase keywords, line numbering, comments, and BNF notation for CAIE CS exams.

---

The following conventions describe how pseudocode appears in Cambridge examination papers (IGCSE 0478 and AS &amp; A Level 9618).

### Font &amp; Indentation

Pseudocode is presented in a **monospaced font** (e.g. Courier New). Lines are indented by three spaces to indicate nesting within a containing statement.

### Case Convention

**Keywords** are in UPPER CASE (e.g. `IF`, `REPEAT`, `PROCEDURE`). **Identifiers** use mixed case / camelCase (e.g. `NumberOfPlayers`). Meta-variables are enclosed in angle brackets `&lt; &gt;`.

### Line Numbering

When lines are numbered, numbers appear to the left and are consecutive. Skipped numbers indicate missing code. Continuation lines are not numbered.

### Comments

Comments are preceded by `//` and continue to the end of the line. Multi-line comments use `//` on each line. Comments normally appear on a separate line before the code they describe.

```pseudocode
// runnable
// SWAP Procedure Example
// this procedure swaps
// values of X and Y
PROCEDURE SWAP(BYREF X : INTEGER, BYREF Y : INTEGER)
   DECLARE Temp : INTEGER
   Temp &lt;- X    // temporarily store X
   X &lt;- Y
   Y &lt;- Temp
ENDPROCEDURE
DECLARE First, Second : INTEGER
First &lt;- 4
Second &lt;- 9
CALL SWAP(First, Second)
OUTPUT First, &quot;, &quot;, Second
```


---

* Next Topic: [Variables, Constants &amp; Data Types](https://csmasters.dev/docs/pseudocode/variables-and-types.md)
