Task

Compute the sum and product of an array of integers.




arraybase 1
dim array(5)
array[1] = 1
array[2] = 2
array[3] = 3
array[4] = 4
array[5] = 5
 
sum = 0
prod = 1
for index = 1 to array[?]
	sum += array[index]
	prod *= array[index]
next index
print "The sum is "; sum            #15
print "and the product is "; prod   #120
end