Start here · Essential guide
What Is Selection in Computer Science?
Selection is how a program picks which code to run based on a condition. Learn how if, if-else, else-if and switch work, with examples and common mistakes.
Computing Foundations
How selection statements let programs make decisions, with notes for AP Computer Science Principles.
Start here · Essential guide
Selection is how a program picks which code to run based on a condition. Learn how if, if-else, else-if and switch work, with examples and common mistakes.
In programming, selection means choosing which code runs based on a condition. See how it differs from sequence and iteration, and other uses of the word.
In AP Computer Science Principles, selection is one of the three basic ways to build an algorithm. Learn what the course expects and how to practice it.
Programs use selection statements to act differently based on input or state. See everyday examples, input checks and when branching gets hard to manage.
Related topics