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
πŸ’¬ Discuss
βœ… Correct Answer: (C) Equal
Explanation: a[3]=4 and b[2]=4 hence it will print equal according to the given if condition
Explanation by: Yami Thakur
a[3]=4 and b[2]=4 hence it will print equal according to the given if condition

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
243
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Yami Thakur
Publisher
πŸ“ˆ
91%
Success Rate