Home / Programming MCQs / Ruby MCQs / Question

V

Vinay Kumar • 8.55K Points
Tutor III

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

Code:
counter = true
while counter !=false
  puts counter
end
(A) TRUE
(B) FALSE
(C) Syntax Error
(D) Infinite Loop
Counter value is true in all cases hence true will be printed infinite times.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.