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:
boolean_var = !true || (true || 36 != 6**2)
puts boolean_var
(A) TRUE
(B) FALSE
(C) Error
(D) None of the above

Explanation:

36 != 6**2 is false and true || false is true but true || !true is true hence the overall expression will evaluate to true.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.