Examveda
Examveda

What is the output of the given code?
age =  4
case age
puts "baby" when 0 .. 2
puts "little child" when 3 .. 6
puts "child" when 7 .. 12
puts "youth" when 13 .. 18
puts "adult" else
end

A. adult

B. youth

C. child

D. syntax error

Answer: Option D


This Question Belongs to Ruby Programming >> Control Structures In Ruby

Join The Discussion

Related Questions on Control Structures in Ruby