In C++ the braces of and if or an else clause can contain another if statement. There are known as nested if statements.
In simple terms a nested if is when you write an IF inside another IF braces.
This is the basic structure of a nested if.
And of course we can nest else if in the similar way as you nest the if statement.
This is an example of a program with nested if-else.
And this will be the output:
Nesting of conditional IF statements. by esaupreciado is licensed under a Creative Commons Attribution 4.0 International License.