Jump to content

Sum and product of an array: Difference between revisions

adding maxima
m (→‎{{header|REXX}}: indented DO loops, changed '''output''' template, removed superfluous blank lines. -- ~~~~)
(adding maxima)
Line 787:
120
504</lang>
 
 
=={{header|Maxima}}==
lreduce("+", [1, 2, 3, 4, 5, 6, 7, 8]);
36
 
lreduce("*", [1, 2, 3, 4, 5, 6, 7, 8]);
40320
 
=={{header|MAXScript}}==
Line 794 ⟶ 802:
product = 1
for i in arr do product *= i</lang>
 
=={{header|Modula-3}}==
<lang modula3>MODULE Sumprod EXPORTS Main;
168

edits

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