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[5]
  2. A.
    400
    B.
    500
    C.
    Nil
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    Array's index start from 0 so array[5] will give nothing. Output: Nil


Be The First To Comment