Sail E0 Webinar
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
Options:
A .  alphabet a
B .  b alphabet b
C .  alphabet c
D .  Syntax error
Answer: Option B


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 ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers