Home / CSE MCQs / Ruby Programming MCQs :: Discussion

Discussion :: Ruby Programming MCQs

  1. What will be the output of the following?

    array = [100, 200, 300, 400, 500]
    print array[4]
  2. A.
    400
    B.
    500
    C.
    Nil
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    Array's index start from 0 so array[4] will give 500. Output: 500


Be The First To Comment