A

Admin • 828.03K Points
Coach

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

Code:
digits = Array(0...9)
puts #{digits}
  • (A) [0, 1, 2, 3, 4, 5, 6, 7, 8]
  • (B) [0, 1, 2, 3, 4, 5, 6, 7, 8]
  • (C) [0, 1, 2, 3, 4, 5, 6, 7, 8,9]
  • (D) [1, 2, 3, 4, 5, 6, 7, 8]
  • Correct Answer - Option(B)
  • Views: 3
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin
This will produce the following result : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.