πŸ“Š Ruby
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]
πŸ’¬ Discuss
βœ… Correct Answer: (B) [0, 1, 2, 3, 4, 5, 6, 7, 8]

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
191
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Yami Thakur
Publisher
πŸ“ˆ
94%
Success Rate