- Home >
- Program C++ >
- Examples and Explanations Order If Else in C++ Language
Posted by : Unknown
Saturday, January 30, 2016
If and else is an election statement / statements to be executed if they meet certain conditions.
Example:
Determine a value is odd or even
Determining a vowel or consonant
1. Single If
The statement in the if will be executed if the condition is true. If the condition is false, if the instruction will not be executed.
if (kondisi) {
Proses;
}
2. If Else
The statement in the if will be executed if the condition is true. If the condition is false, else the instruction to be executed
3. Nested If
If nesting is a form of if statement with another if statement inside the if earlier. Nested form-if it is used to select a number of possible actions.