Task

Compute the sum and product of an array of integers.




a[0] = 3.0
a[1] = 1
a[2] = 4.0
a[3] = 1.0
a[4] = 5
a[5] = 9.00
n = 6
p = 1
for (i = 0; i < n; i++) {
    s += a[i]
    p *= a[i]
}
"Sum: "; s
"Product: "; p