Q. What is the output of the given code?
string = gets.chomp
case string
when string = "a"
print "alphabet a"
when string = "b"
print "alphabet b"
when string = "c"
print "alphabet c"
else
print "some other alphabet"
end

  • (A) alphabet a
  • (B) ruby length is 5
  • (C) alphabet c
  • (D) Syntax error
πŸ’¬ Discuss
βœ… Correct Answer: (B) ruby length is 5

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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