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 = 3**2 != 2**3 || true
puts boolean_var
(A) TRUE
(B) FALSE
(C) 1
(D) 0

Explanation:

2**3=8 and 3**2=9 both the values are not equal is true and true or true will evaluate to true hence the overall expression will evaluate to true.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.