Jump to content

Sum and product of an array: Difference between revisions

m
(added zig)
Line 2,813:
[ 2 4 8 -5 ] SUMPR
</syntaxhighlight>
{{out}}
<pre>
Line 2,819 ⟶ 2,818:
1: -320
</pre>
 
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">arr = [1,2,3,4,5] # or ary = *1..5, or ary = (1..5).to_a
1,150

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.