Algorithms and flowcharts

An algorithm is a precise set of steps to solve a problem. Every program is built from three basic structures.

Practise this lesson free (6 questions)

More tools

Three building blocks

Sequence: steps run one after another in order.
Selection: a decision chooses which steps run, such as IF ... ELSE.
Iteration: steps repeat, using a loop such as FOR or WHILE.

Flowchart symbols

Flowcharts show algorithms visually.
ShapeMeaning
Rounded rectangle (oval)Start or end (terminator)
RectangleProcess, such as a calculation
DiamondDecision, with yes and no paths
ParallelogramInput or output
ArrowDirection of flow

Tracing an algorithm

A trace table follows the value of each variable step by step. It is the best way to find out what an algorithm does or where it goes wrong.
Worked example

What is output? total = 0. FOR i FROM 1 TO 4: total = total + i. OUTPUT total.

  1. i = 1: total = 1
  2. i = 2: total = 3
  3. i = 3: total = 6
  4. i = 4: total = 10

Answer: 10

Key idea

Algorithms use sequence, selection and iteration. Flowchart symbols: oval for start and end, rectangle for process, diamond for decision, parallelogram for input and output. Trace tables track variables.

Key words
Algorithm
A precise sequence of steps to solve a problem.
Sequence
Instructions carried out one after another in order.
Selection
Choosing which code runs using a condition, such as if, elif and else.
Iteration
Repeating code, or visiting each item of a data structure in turn.
Flowchart
A diagram of an algorithm using standard symbols joined by arrows.
Trace table
A table that tracks the value of each variable as an algorithm runs.

All GCSE and International GCSE Computer Science key terms and definitions โ†’

Quick check

Try two quick questions

See if it has sunk in. Answers are marked straight away.

Extra practice

2 more questions

Try each one, then tap to check.

  1. Which programming construct chooses between different paths?

    1. Iteration
    2. Selection
    3. Sequence
    4. Abstraction
    Show the answer

    Answer: Selection

    Selection uses IF to choose a path.

  2. Which flowchart symbol shows a process, such as total = total + 1?

    1. Diamond
    2. Rectangle
    3. Parallelogram
    4. Oval
    Show the answer

    Answer: Rectangle

    A rectangle shows a process.

Check you have got it

Answer 6 quick questions with instant marking. If you get one wrong, GCSE-ready shows you why and gives you another go. It is free, and you do not need an account.

Video for this lesson coming soon. Subscribe on YouTube

Sources and references

Facts checked against the sources below, 17 October 2026. Last updated 2 October 2026. Spotted a mistake? Tell us and we will fix it.

What do exam command words like explain and evaluate mean? โ†’

Related lessons