Skip to content
IGCSE·Tuition
Computer Science · Lesson

Use the 2026-2028 pseudocode convention

You can read pseudocode in a textbook, yet writing your own answer in the same style feels oddly unfamiliar.

On this page
  1. What are the main conventions?
  2. Worked example
  3. The mistake to watch for
  4. Check yourself
  5. Where this leads next

Pseudocode conventions are the agreed way of writing an algorithm: ← for assignment, capital letters for keywords, indentation for blocks. They appear in any exam question that asks you to read, complete or write an algorithm.

This lesson is the foundation of pseudocode for the applicable syllabus. Check the final lesson of the module for how to confirm which notation applies to your exam year.

What are the main conventions?

Cambridge pseudocode uses a small set of patterns. Learn them as a toolkit.

IdeaPseudocode
Declare a variableDECLARE Total : INTEGER
Assign a valueTotal ← 0
Input and outputINPUT Mark, OUTPUT Total
SelectionIF ... THEN ... ELSE ... ENDIF
Count-controlled loopFOR Count ← 1 TO 5 ... NEXT Count
Pre-condition loopWHILE ... DO ... ENDWHILE
Post-condition loopREPEAT ... UNTIL ...
Comparison=, <>, <, >, <=, >=

Three habits make your answers readable. Write keywords in capitals, indent everything inside a structure, and close every structure with its ending keyword.

Worked example

Write pseudocode that reads three marks, then outputs their average. Test with 12, 15 and 9.

DECLARE Mark1, Mark2, Mark3 : INTEGER
DECLARE Average : REAL
INPUT Mark1
INPUT Mark2
INPUT Mark3
Average ← (Mark1 + Mark2 + Mark3) / 3
OUTPUT Average

Trace with inputs 12, 15, 9:

LineMark1Mark2Mark3Average
after the INPUT lines12159
Average ← …1215912

The sum is 12 + 15 + 9 = 36, and 36 ÷ 3 = 12. The output is 12. Check again: 12 × 3 = 36, so the average is right.

The brackets matter. Without them, the line would divide only Mark3 by 3 and add the rest, giving 12 + 15 + 3 = 30.

The mistake to watch for

A common slip is to carry over a programming language’s symbols.

Mistaken line: Average = (Mark1 + Mark2 + Mark3) / 3

In the convention, = is a comparison. This line asks “are these equal?”, rather than storing the result.

The correction is Average ← (Mark1 + Mark2 + Mark3) / 3. Python and many other languages do use = for storing, which is why the habit transfers so easily. When an exam asks for pseudocode, switch back to ← deliberately.

Check yourself

1. Write one line of pseudocode that stores 20 in a variable called Limit.

Show answer

Limit ← 20

2. What is wrong with this loop?

FOR Count ← 1 TO 3
   OUTPUT Count
Show answer

It has no closing keyword. Add NEXT Count after the indented line. With it, the loop outputs 1, 2 and 3.

3. Using the three-mark example, what would the average be for 10, 10 and 4?

Show answer

The sum is 24, and 24 ÷ 3 = 8. The output is 8.

Where this leads next

Next, practise reading a line correctly in tracing assignment and comparison distinctly. The restricted pseudocode trace trainer is useful for checking a trace once you have done it by hand.

Style habits are hard to spot in your own writing. Teachers on our online one-to-one Computer Science tuition can read your answers as an examiner would and point out exactly which habit to fix.

Questions people ask

Does my pseudocode need exactly the same keywords as the syllabus guide?

Aim to follow the published conventions closely, because that is what examiners expect to read. Small slips in spelling matter less than clear logic, but mixing in another language's symbols can make an answer ambiguous. Check the pseudocode guide on the Cambridge syllabus page for your exam year.

Do I have to use the arrow symbol when I type my answer?

The arrow is the standard assignment symbol in the Cambridge guide. If you handwrite, draw it clearly. If your paper is typed, use the symbol your question paper shows, and keep it consistent through the whole answer.

Are keywords case sensitive?

Convention writes keywords such as IF, WHILE and OUTPUT in capitals, which makes them stand out from variable names. Being consistent matters most. Pick capitals for keywords and a clear style for variables, then keep it throughout.

Sources

  1. Cambridge IGCSE Computer Science 0478 subject page

Updated:

Your next step

If your pseudocode keeps drifting into Python habits, a one-to-one teacher can mark your answers against the convention and help you settle into one style.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80.

Tuition is arranged with a parent or guardian. Send them this page on WhatsApp and they can enquire for you.

Parents: enquire here

  • 9,000+ students helped through our service
  • 9+ years helping IGCSE students