πŸ“Š Ruby
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
πŸ’¬ Discuss
βœ… Correct Answer: (A) 0 1 2 3 4

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
52
Total Visits
πŸ“½οΈ
9 mo ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
90%
Success Rate