Selection Statements

Control statements control the flow of the program execution either by repeating or skipping the set of statements based on the result of the test condition. Control statements are categorized into four parts i.e., sequential statement, selection statement, looping statement and jump statement.

The sequential statement does not contain any test condition. A condition check always gives either of the following two values: True or False. The various types of selection statements are single selection, double selection and multiple selection statement. The if statement is used to check a test condition in a program. The if-else-if ladder is used to check more than one condition. The switch statement is used to execute the statements based on more than one test condition. If control flows to the next case below the matching case, in absence of break, it is called fall-through. The conditional operator operates with three operands thus it is also called ternary operator.

To Access the full content, Please Purchase