A

Admin • 828.03K Points
Coach

Q. What will be the output of the given ruby code?

Code:
a=[1,2,3,4,5]
b=[1,2,4,6,8]
if a[3]==b[2]
print Equal
end
  • (A) TRUE
  • (B) FALSE
  • (C) Equal
  • (D) error
  • Correct Answer - Option(C)
  • Views: 4
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin
a[3]=4 and b[2]=4 hence it will print equal according to the given if condition

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.