Examveda

What is the output of the given code?
multi_d_array = [[1,2,3,4],[0,0,0,0]]
multi_d_array.each { |x| puts "#{x}\n" }

A. [1, 2, 3, 4].
[0, 0, 0, 0].
[[1, 2, 3, 4], [0, 0, 0, 0]].

B. [0, 0, 0, 0].

C. [0, 0, 0, 0][0, 0, 0, 0].

D. None of the mentioned

Answer: Option A


Join The Discussion

Related Questions on Arrays, Hashes and Strings in Ruby