Selection Statements in C++
C++ provides three types of selection statements (discussed in this chapter and Chapter 5). The
if selection statement either performs (selects) an action if a condition is true or skips the action if the condition is false. The
else selection statement performs an action if a condition is true or performs a different action if the condition is false. The
switch selection statement (Chapter 5) performs one of many different actions, depending on the value of an integer expression.
if selection statement is a single-selection statement because it selects or ignores a single action (or, as you’ll soon see, a single group of actions). The
else statement is called a double-selection statement because it selects ...