Question
What is the output of the given code?string = gets.chompcase stringwhen string = "a"print "alphabet a"when string = "b"print "alphabet b"when string = "c"print "alphabet c"else print "some other alphabet"end
Answer: Option B
Was this answer helpful ?
After taking input from the user will check which string is entered and goes to particular case statement.
Output:
b
alphabet b
Was this answer helpful ?
Submit Solution