Algorithms and flowcharts

An algorithm is a precise set of steps. Flowcharts show an algorithm as a diagram, so you can follow it before writing any code.

Practise this lesson free (6 questions)

More tools

Sequence, selection and iteration

Every algorithm is built from three building blocks.
Sequence: steps happen in order, one after another.
Selection: a decision chooses which steps to do (if ... then ... else).
Iteration: steps are repeated (a loop).

Flowchart symbols

A loop in a flowchart is an arrow that goes back to an earlier step.
ShapeMeaning
Rounded rectangle (terminator)Start or Stop
Rectangle (process)Do something, such as a calculation
Diamond (decision)A Yes/No question: selection
ParallelogramInput or output
ArrowShows the order to follow

Following an algorithm

Algorithm: INPUT a number. Double it. IF the result is more than 10, subtract 4. OUTPUT the result.
Input 3: double = 6. 6 is not more than 10. Output 6.
Input 7: double = 14. 14 is more than 10, so 14 - 4. Output 10.
Worked example

Use the algorithm: INPUT a number, double it, IF the result is more than 10 subtract 4, OUTPUT the result. What is output for 9?

  1. Double 9: 18.
  2. 18 is more than 10, so subtract 4: 14.

Answer: 14

Key idea

Algorithms use sequence, selection and iteration. Flowcharts use a rounded box for start/stop, a rectangle for a process, a diamond for a decision and a parallelogram for input/output.

Key words
AND
A Boolean operator that gives True (1) only when both inputs are True.
Algorithm
A precise set of step-by-step instructions to solve a problem or complete a task.
Sequence
Instructions carried out one after another, in order.
Selection
Choosing which code to run depending on a condition, using if, elif and else.
Iteration
Repeating a set of instructions, using a loop.
Input
Data put into a computer, for example from a keyboard, mouse, microphone or sensor.

All KS3 Computing 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. A flowchart step asks 'Is the number greater than 10?'. Which shape should it be?

    1. Rectangle
    2. Parallelogram
    3. Diamond
    4. Rounded rectangle
    Show the answer

    Answer: Diamond

    A Yes/No question is a decision: a diamond.

  2. A flowchart step says 'Display the total'. Which shape should it be?

    1. Diamond
    2. Rectangle
    3. Rounded rectangle
    4. Parallelogram
    Show the answer

    Answer: Parallelogram

    Output uses a parallelogram.

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, 27 October 2026. Last updated 2 October 2026. Spotted a mistake? Tell us and we will fix it.

Related lessons