Question: Match the conditional expression with the if-else statement that performs the same operation. a. q = x < y ? a + b : x
Match the conditional expression with the if-else statement that performs the same operation.
a. q = x < y ? a + b : x * 2;
b. q = x < y ? x * 2 : a + b;
c. q = x < y ? 0 : 1;
____ if (x < y)
q = 0;
else
q = 1;
____ if (x < y)
q = a + b;
else
q = x * 2;
____ if (x < y)
q = x * 2;
else
q = a + b;
Step by Step Solution
3.48 Rating (168 Votes )
There are 3 Steps involved in it
Solution a q x y a b x 2 b q x ... View full answer
Get step-by-step solutions from verified subject matter experts
