Written by the Fiveable Content Team • Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 exam•Written by the Fiveable Content Team • Last updated September 2025
Definition
Selection statements are used in programming to make decisions based on certain conditions. They allow the program to choose between different paths of execution depending on whether a condition is true or false.
Related terms
If Statements: These are used to execute a block of code only if a specific condition is true.
Else Statements: These are used in conjunction with if statements to specify an alternative block of code that should be executed when the condition is false.
Switch Statements: These allow for multiple possible paths of execution based on the value of a variable.