πŸ“Š Ruby
Q. What is the output of the given code?
x=1
if x > 2
puts "x is greater than 2"
elsif x <= 2 and x!=0
puts "x is 1"
else
puts "I can't guess the number"
end
  • (A) x is greater than 2
  • (B) When the if condition is false then the elsif condition will get executed
  • (C) I can't guess the number
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) When the if condition is false then the elsif condition will get executed

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
92
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
83%
Success Rate