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?
unless true && false
print “false”
else
print “ruby”
end

What is the output of the given code?
unless true && false
print “false”
else
print “ruby”
end
a) True
b) False
c) Nil
d) Syntax error

Answer: b
Explanation: true && false will evaluate to false so unless block will get executed.

Join The Discussion