Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the output of the given code?
x=3
unless x>2
puts “x is less than 2”
else
puts “x is greater than 2”
end

What is the output of the given code?
x=3
unless x>2
puts “x is less than 2”
else
puts “x is greater than 2”
end
a) x is greater than 2
b) x is less than 2
c) 3
d) None of the mentioned

Answer: a
Explanation: The unless conditional statement is true so the unless clause is not executed.

Join The Discussion