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

Explanation by: Vinay Kumar
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.


Question analytics