What is “The if...elseif...else” Statement“?
The special Statement (if…elseif…else) is used to combine multiple Statements (if…else). The if-else-if-else statement allows you to combine multiple If-else statements, allowing the compiler to specify behaviors with more than two possible outcomes.
if (condition) {
code to be executed if this condition is true;
} else if (condition) {
code to be executed if first condition is false and this condition is true;
} else {
code to be executed if all conditions are false;
}

Example1:- If this condition is true!
Output:-

Example2:- If first condition is false and this condition is true!
Output:-

Example3:- If all conditions are false!
Output:-

Latest posts by Ashwani Kumar (see all)
- Top 10 DevOps Trainers in the world - October 7, 2023
- What is Cookies and Why it is Used? - May 24, 2023
- TOP trends of transitions in TikTok - May 10, 2023