Task

Compute the sum and product of an array of integers.




dim array(5)
data 1, 2, 3, 4, 5
for index = 1 to arraysize(array(), 1)
    read array(index)
next index
 
sum = 0
prod = 1
for index = 1 to arraysize(array(), 1)
    sum = sum + array(index)
    prod = prod * array(index)
next index
print "The sum is ", sum            //15
print "and the product is ", prod   //120
end