Home / CSE MCQs / Ruby Programming MCQs :: Discussion

Discussion :: Ruby Programming MCQs

  1. What is the output of the given code?

    a=[1,2,3,4,5]
    b=[1,2,4,6,8]
    if a[3]==b[2]
        print "Equal"
    end
  2. A.
    Equal
    B.
    Error
    C.
    4
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    a[3]=4 and b[2]=4 hence it will print equal according to the given if condition. Output: Equal


Be The First To Comment