Accessibility
Fiducia Together logoFiducia Together

Selection and iteration

IF statements and loops. The two structures that make a program do more than run top to bottom.

Please note: This page explains a word or a process in education. It is general information about the system, the law and the guidance in England — not advice about your child, your school or your exam. If a decision is going against you, get advice from one of the free services we link to before you agree to anything or miss a deadline. If you are revising, check your own exam board's specification: boards word things differently and yours is the one that marks you.

What it is

Sequence is one instruction after another. Selection chooses between paths with IF, ELSE IF and ELSE, or a CASE statement. Iteration repeats: a FOR loop for a known number of times, a WHILE loop while a condition holds, a REPEAT UNTIL loop at least once.

Where it applies

GCSE and A Level computer science.

How it works

Count-controlled iteration (FOR) is used when the number of repetitions is known in advance; condition-controlled (WHILE) when it is not.

A WHILE loop can run zero times; a REPEAT UNTIL always runs at least once. That difference is examined.

How to use it in your work

Choose the right loop and be ready to justify it. "A WHILE loop, because the number of guesses is not known in advance."

Watch for infinite loops: something inside the loop must be able to change the condition.

Nested loops multiply — a loop of 10 inside a loop of 10 runs 100 times, and questions ask exactly this.

Where to get help

Your teacher and your board's specification — the pseudocode and the required language differ between boards. Bitesize covers the concepts; the computer science song runs the topics.

Revise this with a song

These are ours. We write revision songs because a lot of people remember a tune when they cannot remember a page, and because revising out loud in the kitchen beats staring at a highlighter.

Where to read more

Last reviewed 2026-08-28 by Fiducia Together · Next review due 2027-08-28

Please note: This page explains a word or a process in education. It is general information about the system, the law and the guidance in England — not advice about your child, your school or your exam. If a decision is going against you, get advice from one of the free services we link to before you agree to anything or miss a deadline. If you are revising, check your own exam board's specification: boards word things differently and yours is the one that marks you.

Accessibility toolkit

Done

Profiles


Text

Text size100%
Off
100%

Colour & contrast


Reading & focus

Saved to this browser for 6 months. Signed in to a Fiducia app? Set it up there instead and it follows you onto any device.

Cookies on this site

We use one cookie to remember your reading and accessibility settings, and one to remember this choice. Neither is used to track you. This site sets no advertising or analytics cookies of its own, and visits are counted on our own server, so nothing follows you off this page. Read our privacy policy.