3.15 The Conditional Operator: '?'

The ternary conditional operator allows conditional expressions to be defined. The operator has the following syntax:

<condition>?<expression1>:<expression2>

If the boolean expression <condition> is true then <expression1> is evaluated; otherwise, <expression2> is evaluated. Of course, <expression1> and <expression2> must evaluate to values of compatible types. The value of the expression evaluated is returned by the conditional expression.