Home / Programming MCQs / Ruby MCQs / Question

V

Vinay Kumar • 8.45K Points
Tutor III

Q. What will be the output of the given code?

Code:
num=(10<11)||(11===11)? (11===11.0): 0
puts num
(A) TRUE
(B) FALSE
(C) 1
(D) 0

Explanation:

First check 10<11 it return true then no need to check 11===11 , condition becomes true now go to next statement 11===11.0 and it will return true.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.