Which combination of the integer variables x, y and z makes the variable a get the value 4 in the following expression?
a = ( x > y ) ? (( x > z ) ? x : z) : (( y > z ) ? y : z ) |
chevron_right
filter_none
(A) x = 3, y = 4, z = 2
(B) x = 6, y = 5, z = 3
(C) x = 6, y = 3, z = 5
(D) x = 5, y = 4, z = 5
Answer: (A)
Explanation: The given expression assigns maximum among three elements (x, y and z) to a.
Quiz of this Question
Recommended Posts:
- GATE | GATE CS 2008 | Question 1
- GATE | GATE CS 2008 | Question 2
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 4
- GATE | GATE CS 2008 | Question 5
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 8
- GATE | GATE CS 2008 | Question 9
- GATE | GATE CS 2008 | Question 10
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 12
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 14
- GATE | GATE CS 2008 | Question 15
- GATE | GATE CS 2008 | Question 16
- GATE | GATE CS 2008 | Question 17
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 20
- GATE | GATE CS 2008 | Question 21

