ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
What is the output of the given code
a=["hey", "ruby", "language"]
b=["hey", "language", "ruby"]
if a==b
print "Equal"
else
print "Not equal"
end
Correct Answer: D — Not equal
a and b have identical elements [1,2,3,4]. In Ruby, arrays are equal if they have the same elements in the same order. So the output is 'Equal'.