Please enable JavaScript.
Coggle requires JavaScript to display documents.
3.0 SELECTION STATEMENTS, Switch..case - Coggle Diagram
3.0 SELECTION STATEMENTS
Selection statement execute a set of instructions only one. Select between one statement or another.
-
-
-
-
-
- Two-way decision using the IF-ELSE statement
- Pseudocode of IF –ELSE structure
-
- Nested if else statements are used when a series of decision are involed.
- Nested if...else statement (if...else if....else Statement)
- The nested if...else statement is used when program requires more than one test expression.
- One way decision the statement.
- If statement allows decision to be made by evaluating a given expression as true or false.
-
- Switch is a multi branching control statement.
- Used for multiple way selections that will branch into different code segments based on the value of a variable or expression.
- This expression or variable must be of integer data type.
- Syntax for switch statement is shown below.
- Break- it is used to exit from a loop or switch
-
-