Sum and product of an array: Difference between revisions

no edit summary
No edit summary
Line 1,911:
product of M elements for the @ array is: 2432902008176640000
</pre>
 
=={{header|Ring}}==
<lang ring>
aList = 1:10 nSum=0 nProduct=0
for x in aList nSum+=x nProduct *= x next
See "Sum = " + nSum + nl
See "Product = " + nProduct + nl
</lang>
 
=={{header|Ruby}}==