Flow of control
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 categorised into four parts i.e., sequential statement, selection statement, looping statement and jump statement. In a sequential statement, the statements are executed one by one till the end of a program. It does not contain any test condition. In a selection statement, the statements execute according to the result of one condition check. 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 statement is used to make decision based on the result of the test condition. If the condition is true, it executes statement1, otherwise, it executes statement2. 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. In absence of a break statement, the control flows to the next case below the matching case. This is called fall-through.
To Access the full content, Please Purchase