Ruby - Control Flow
Which of the following is the correct syntax for a case/when statement in Ruby?
case x
when 1
puts "One"
when 2
puts "Two"
else
puts "Other"
endWhich of the following is the correct syntax for a case/when statement in Ruby?
case x
when 1
puts "One"
when 2
puts "Two"
else
puts "Other"
endcase followed by when clauses and ends with end. No braces or colons are used.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions