A

Admin • 833K Points
Coach

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

Code:
i=1
for i in 6..10
puts i**2
end
  • (A) 36 49 64 81
  • (B) 49 64 81 100
  • (C) 49 64 81
  • (D) 36 49 64 81 100
  • Correct Answer - Option(D)
  • Views: 12
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin

The output for the following code is 36 49 64 81 100.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.