Selection (IF Statements)

Computer ScienceOCRGCSEUnit: 3.2 Programming
Free taster
5 of 6 sections open
The basics

Making Decisions

Making Decisions

Life is full of decisions: "IF it's raining, take an umbrella, ELSE wear sunglasses." Programs work the same way. Selection lets programs choose different paths based on conditions. IF the user enters the correct password, let them in. ELSE, show an error. Multiple choices? Use ELSEIF or SWITCH/CASE. Every game, every app makes thousands of decisions every second!

Now try it yourself

Quiz · Question 1 of 15

Which programming construct is used to make a decision based on a condition?

Tap an answer to check it

Revise every Computer Science topic, free during alpha

Selection (IF Statements) is one of 60 topics on PrepWise — all aligned to your exam board.

Start revising free →