Switchnum = 3 case numwhen 1 p "one"when 2 p "two"when 3 p "three"else p "greater than 3"end # Output:$ruby main.rb"three"Copy