M

Mr. Dubey • 87.94K Points
Coach

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
  • Correct Answer - Option(B)
  • Views: 65
  • Filed under category Ruby

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics