Ruby - Control Flow
What is the output of this Ruby code?
score = 85 case score when 90..100 puts "Excellent" when 80..89 puts "Good" when 70..79 puts "Average" else puts "Fail" end
What is the output of this Ruby code?
score = 85 case score when 90..100 puts "Excellent" when 80..89 puts "Good" when 70..79 puts "Average" else puts "Fail" end
when 80..89 clause matches, so it executes puts "Good".15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions