Sail E0 Webinar
Question
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
Options:
A .  false
B .  true
C .  neither true nor false
D .  none of the mentioned
Answer: Option B


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



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers