Home / CSE MCQs / Ruby Programming MCQs :: Discussion

Discussion :: Ruby Programming MCQs

  1. What is the output of the given code?

    m= 8
    loop do
        m += 2
        puts m
        break if m == 16
    end
  2. A.
    10 12 14 16
    B.
    Nil
    C.
    Error
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Execute the loop till the condition is met. Output: 10 12 14 16


Be The First To Comment