1

What is the output of the given code? x=1 if x > 2 puts "x is greater than 2" elsif x <= 2 and x!=0 puts "x is 1" else puts "I can't guess the number" end

Correct Answer: When the if condition is false then the elsif condition will get executed

Make the most of this question

This page focuses on one Ruby MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.