Home / CSE MCQs / Ruby Programming MCQs :: Discussion

Discussion :: Ruby Programming MCQs

  1. What is the output of the given code?

    for num in 1..5
      puts num*num
    endx
  2. A.
    12345678910
    B.
    1 2 3 4
    C.
    1 4 9 16 25
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    Loop till the condition is met and break when the condition is not satisfied. Output: 1 4 9 16 25


Be The First To Comment