Home / CSE MCQs / Ruby Programming MCQs :: Discussion

Discussion :: Ruby Programming MCQs

  1. What is the output of the given code?

    a=true
       b=false
       if a && b
       puts "False"
       elsif a || b
       puts "True"
       else
       puts "neither true nor false"
       end
  2. A.
    false
    B.
    true
    C.
    neither true nor false
    D.
    none of the mentioned

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    True or false will always evaluate to true, hence the elsif block is executed.


Be The First To Comment