Pseudocode and algorithms

Pseudocode and algorithms

Pseudocode is used to describe an algorithm in a way that is not specific to any one programming language. Some pseudocodes are relatively simple:

IF BankBalance < 0 THEN
     Display overdrawn message
ELSE
     Display not yet in debt message
ENDIF

Some pseudocodes follow a detailed set of conventions and use specialist symbols – and may not use monospace fonts:

for i ← 1 to n do
       
⋮                               ▷    the body of the loop goes here
end for

[Reserved words are written in bold, variables in italic; the leftwards arrow is used for assignment, and the rightwards triangle, like a flag, indicates a comment.]

Find and follow the pseudocode conventions of the publication you are writing for. See Computing style resources.

Return to top

User login

... or purchase now

An individual subscription is only A$60 per year

Group and student discounts may apply

Australian manual of scientific style Start communicating effectively

Purchase