Task

Compute the sum and product of an array of integers.




lvars i, sum = 0, prod = 1, ar = {1 2 3 4 5 6 7 8 9};
for i from 1 to length(ar) do
    ar(i) + sum -> sum;
    ar(i) * prod -> prod;
endfor;