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.
int max(int a, int b){ // returns the larger of two integers
(a > b) ? return a : return b;
}