How can you rewrite the following conditional statement using a ternary operator?
if (a - b > 0) {
c = a - b;
} else {
c = a + b;
}
All variables are integers.
Choose all suitable cases.
How can you rewrite the following conditional statement using a ternary operator?
if (a - b > 0) {
c = a - b;
} else {
c = a + b;
}
All variables are integers.
Choose all suitable cases.
Create a free account to access the full topic