πŸ“Š Ruby
Q. What will be the output of the given code?
Code:
for i in 1..5 && j in 5..10
puts i+j
end
  • (A) 6 8 10 12 14 16
  • (B) Syntax Error
  • (C) 6 8 10 12 14
  • (D) Type Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) Syntax Error

Explanation: syntax error, unexpected keyword_in, expecting keyword_do_cond.

Explanation by: Vinay Kumar
syntax error, unexpected keyword_in, expecting keyword_do_cond.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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