Task

Compute the sum and product of an array of integers.




Dim array(19)
 
For i = 0 To 19
    array(i) = Int(Rnd(1) * 20)
Next i
 
'product must first equal one or you will get 0 as the product
product = 1
For i = 0 To 19
    sum = (sum + array(i))
    product = (product * array(i))
next i
 
Print "Sum is " + str$(sum)
Print "Product is " + str$(product)