Multiple choice technology programming languages

Find output? [1,2,3].each do |i| print i*2 end

  1. 123

  2. 468

  3. 246

  4. 439

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The each block iterates over [1,2,3]. For each element i, it prints i*2 without separation. So it prints 2, then 4, then 6 on the same line: '246'. The print method doesn't add newlines automatically.