Ruby - Loops and Iteration
What will be the output of this Ruby code?
3.times { |i| puts i * 2 }3.times { |i| puts i * 2 }3.times runs the block 3 times with i values 0, 1, 2.i * 2: 0*2=0, 1*2=2, 2*2=4.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions