Home / Programming MCQs / Ruby MCQs / Question

M

Mr. Dubey • 51.17K Points
Coach

Q. 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

(A) x is greater than 2
(B) When the if condition is false then the elsif condition will get executed
(C) I can't guess the number
(D) None of the mentioned

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.