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=”ruby”.length
y=”language”.length
puts x,y
unless x>y
print “length of x is less than that of y”
end

What is the output of the given code?
x=”ruby”.length
y=”language”.length
puts x,y
unless x>y
print “length of x is less than that of y”
end
a) 4
8
b) 4
8
length of x is less than that of y
c) Syntax error
d) None of the mentioned

Answer: b
Explanation: The .length method will give the length of the string.

Join The Discussion