Cold Help System: Programming: ColdC Reference Manual: Language Structure: Statements: Conditional: if-else


The if-else statement is similar to the if statement. It further extends the if statement's syntax to include a second statement for when the condition expression evaluates false. It has the following syntax:

if (condition expression)
true statement
else
false statement

When the interpreter encounters the if-else statement it will first evaluate the condition expression. If the value of the condition expression is true, it will execute the true expression, otherwise it will execute the false expression. The compound statement can be used to group multiple statements.


if | if-else | switch


the Cold Dark