The if statement verifies the given condition and decides whether a block of statements are executed or not based on the condition’s result. In C++, the if statement is classified into four types as follows …
- Simple if statement
- if – else statement
- Multiple if statement
- Nested if statement
- if-else-if statement (if-else ladder)