KoderPlace
PostCode
Blog
Sign in
KoderPlace
KoderPlace
PostCode
Blog
Login
iterate values with arrays in ruby inner loops
ruby
5 years, 11 months ago
array = [[1, 2, 3, 4], [5, 6, 7, 8]] (array).each do |subarray| (subarray).each do |number| puts "#{number}X2 = #{number*2}" end end =begin Output 1X2 = 2 2X2 = 4 3X2 = 6 4X2 = 8 5X2 = 10 6X2 = 12 7X2 = 14 8X2 = 16 =end
891
0
0
Share
kishore_kumar
Posted By
0 Comments
Please Login to Comment Here
0 Comments
Please Login to Comment Here