A

Admin • 828.03K Points
Coach

Q. What is the output of '5.times { |i| puts i }'?

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

Explanation by: Admin
'times' iterates from 0 up to one less than the number.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.