Sum and product of an array: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,915: | Line 1,915: | ||
<lang ring> |
<lang ring> |
||
aList = 1:10 nSum=0 nProduct=0 |
aList = 1:10 nSum=0 nProduct=0 |
||
for x in aList nSum+=x nProduct *= x next |
for x in aList nSum += x nProduct *= x next |
||
See "Sum = " + nSum + nl |
See "Sum = " + nSum + nl |
||
See "Product = " + nProduct + nl |
See "Product = " + nProduct + nl |