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 = !(100 / 10 === 10)
puts boolean_var
(A) TRUE
(B) FALSE
(C) Type Error
(D) Syntax Error

Explanation:

100/10=10 which is true but the ! before 100/10==10 will evaluate to false hence the overall expression will evaluate to false.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.