Home / CSE MCQs / Ruby Programming MCQs :: Discussion

Discussion :: Ruby Programming MCQs

  1. What will be the output of the following?

    array1 = [100, 200, 300, 400, 500]
    array2 = [1,2,3,4,5]
    if array1 == array2
    print "They are equal"
    else 
        print "Not equal"
    end
  2. A.
    They are equal
    B.
    Not equal
    C.
    Nil
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    Two arrays are said to be equal if each and every element of both the arrays are equal. Output: Not equal


Be The First To Comment