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”.length
if variable
puts “true”
else
puts “false”
end

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

Answer: b
Explanation: Condition is satisfied, and it is not effected by length method.

Join The Discussion