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 code?
variable=true
if variable
puts “true”
else
puts “false”
end

What is the output of the code?
variable=true
if variable
puts “true”
else
puts “false”
end
a) False
b) True
c) Syntax error
d) None of the mentioned

Answer: b
Explanation: The condition is satisfied hence the if block code is executed.

Join The Discussion