Vidyalelo
Ruby Programming · Q86

Control Structures in Ruby

Programming · Ruby Programming · question 86

Q86

What is the output of the given code? length=gets.chomp case length.length when length=4 print "length is 4" when length=5 print "length is 5" end

A.
ruby
length is 4
Answer
B.
ruby
length is 5
C.
abc
length is 4
D.
syntax error

Answer: Option A

Solution

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