Q. What is the output of the following code snippet?
x = 1
loop do
puts x
x += 1
break if x > 5
end

  • (A) 1 2 3 4 5
  • (B) 1 2 3 4
  • (C) 5 4 3 2 1
  • (D) 1 1 1 1 1
πŸ’¬ Discuss
βœ… Correct Answer: (A) 1 2 3 4 5

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
191
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
89%
Success Rate