Ruby - Loops and Iteration
Which of the following is the correct syntax to print numbers 0 to 4 using
times in Ruby?times in Ruby?times syntaxtimes on an integer with a block, either with do...end or curly braces.5.times do |i| puts i end, which is valid Ruby syntax to print 0 to 4.integer.times do |i| ... end for correct syntax [OK]times(5) which is invalid{ i in ... }15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions