A

Admin • 833K Points
Coach

Q. What is the output of the given code?
i = 0
while i < 5
puts i
i=(i+1)**2
end

  • (A) 1 2 3 4 5
  • (B) 0 1 4
  • (C) 0 1
  • (D) 1 4
  • Correct Answer - Option(B)
  • Views: 19
  • Filed under category Ruby
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.