Comparison operators are often used with if statements (see Chapter 23) to control program flow.
Chapter 16
Ternary Conditional Operator
You use the ternary conditional operator to evaluate a question and then do one of two things based on the result of the question. The ternary conditional operator is written like this: question ? actionl action2 (see Listing 16-1).
The question is an expression that returns a boolean true or false. If the question returns true, then the first action takes place. If the question returns false, then the second action takes place.