Home / Programming MCQs / Ruby MCQs / Question

V

Vinay Kumar • 8.55K Points
Tutor III

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
Explanation by: Vinay Kumar
syntax error, unexpected keyword_in, expecting keyword_do_cond.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.