Tell me an array [1,2,34,5,6,7,8,9], product it using a method?
Answer Posted / Amit Ranjan Pandey
"In Ruby, you can multiply each element in the array using the inject method. Example: [1,2,34,5,6,7,8,9].inject(:*) will return 3072000."
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers