Q. What will be the output of the given code?
Code:
for num in 1...5 puts num end
β
Correct Answer: (A)
1 2 3 4
Explanation: As the range i.e 1...5 is exclusive the loop will loop till 4 and then it will come out of the loop.