Vidyalelo
Ruby Programming · Q84

Control Structures in Ruby

Programming · Ruby Programming · question 84

Q84

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.
b
alphabet b
Answer
C.
alphabet c
D.
Syntax error

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board