Home / CSE MCQs / Ruby Programming MCQs :: Discussion

Discussion :: Ruby Programming MCQs

  1. What is the output of the given code?

    if !true
       print "False"
       elsif !true || true
       print "True"
       end
  2. A.
    True
    B.
    False
    C.
    Syntax eroor
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    !true || true evaluates to true, hence elsif block gets executed. Output: True


Be The First To Comment