If the condition is true, statement1
is executed. If the condition is false, statement2
is executed.
- This is appropriate in situations where the conditions and statements are fairly compact.
// returns the larger of two integers
int max(int a, int b)
{
(a > b) ? return a : return b;
}