0
, then use an
if
statement:
if (Boolean expression) statement
0
, and another when the
expression evaluates to 0
, then use an if-else
statement:
if (Boolean expression) if-true statement else if-false statement
if
or
if-else
statement, then use braces to combine those
statements into a single compound statement.
if-else
statements, then use
braces to clarify your grouping intention.
Boolean expression ? if-true expression : if-false expression