πŸ“Š Ruby
Q. What will be the output of the given code?
Code:
for i in 1...3  
  for j in 1..3
  puts j
  end
end
  • (A) 1 2 1 2
  • (B) 0 1 2 0 1 2
  • (C) 1 2 3 1 2 3
  • (D) 1 2 3 1 2
πŸ’¬ Discuss
βœ… Correct Answer: (C) 1 2 3 1 2 3

Explanation: The program will print 1 2 3 two times.

Explanation by: Vinay Kumar
The program will print 1 2 3 two times.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
151
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Vinay Kumar
Publisher
πŸ“ˆ
89%
Success Rate