GATE | GATE CS 2008 | Question 85

Which combination of the integer variables x, y and z makes the variable a get the value 4 in the following expression?

filter_none

edit
close

play_arrow

link
brightness_4
code

a = ( x > y ) ? (( x > z ) ? x : z) : (( y > z ) ? y : z )

chevron_right


(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



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.