Rewriting a conditional statement

Report a typo

A friend of yours wants to rewrite the following conditional statement using a ternary operator?

if (a - b > 0) {
    c = a - b;
} else {
    c = a + b;
}

Choose all the correct options that exactly match the conditional statement but use a ternary operator instead.

Select one or more options from the list

Create a free account to access the full topic