I have come across the following code in C#.
if(condition0) statement0;
else if(condition1) statement1;
else if(condition2) statement2;
else if(condition3) state
The Selection Statement of the C# Language Specification only shows if
and switch
statements. If you select the if
statement, it says:
The if statement selects a statement for execution based on the value of a Boolean expression.
if-statement:
if ( boolean-expression ) embedded-statement
if ( boolean-expression ) embedded-statement else embedded-statement boolean-expression: expression
An else part is associated with the lexically nearest preceding if that is allowed by the syntax