A

Admin • 833K Points
Coach

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
  • Correct Answer - Option(D)
  • Views: 19
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin

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.

Be the first to start discuss.