Home / CSE MCQs / Ruby Programming MCQs :: Discussion

Discussion :: Ruby Programming MCQs

  1. What is the output of the given code?

    m= 0
    loop do
        m += 1
        print m
        break if m == 10
    end
  2. A.
    12345678910
    B.
    1 2 3 4
    C.
    2 3 4 5
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Loop till the condition is met and break when the condition is not satisfied. Output: 12345678910


Be The First To Comment