Consider the following code segment: int x = 22, y = 15; x = (x > y) ? (x + y)…
KVS TGT/PGT 2018Kendriya Vidyalaya Sangathan 2018
Consider the following code segment:
int x = 22, y = 15;
x = (x > y) ? (x + y) : (x - y);What will be the value of x after the code is executed?
- A.
22
- B.
37
- C.
7
- D.
37 and 7
Attempted by 666 students.
Sign up free to check your answer
Sign up freeLoading lesson…

