Prepare for the A Level Computer Science OCR Exam with engaging quizzes, detailed explanations, and effective study tips. Maximize your readiness and boost your confidence for exam day!

Practice this question and more.


What does a selection statement typically consist of in programming?

  1. A numerical range for processing

  2. A directive to loop through all data

  3. Conditional instructions based on criteria

  4. A linear sequence of commands

The correct answer is: Conditional instructions based on criteria

A selection statement in programming is fundamentally about making decisions based on conditions. It typically consists of conditional instructions that allow the program to execute different paths based on whether certain criteria are met. For instance, structures like "if", "else if", and "else" allow the program to evaluate a condition; if the condition evaluates to true, the specific block of code associated with that condition is executed, and if it evaluates to false, the program either moves to an alternative block or continues with the next statement. This aspect of control flow is essential for creating dynamic and interactive programs, as it enables a response to different inputs or states in the program's execution, reflecting real-world decision-making processes. By design, selection statements empower a program to dictate its behavior based on varying conditions, making them fundamental to any programming language.