Task

Compute the sum and product of an array of integers.




Public Sub Main()
Dim iList As Integer[] = [1, 2, 3, 4, 5]
Dim iSum, iCount As Integer
Dim iPrd As Integer = 1
 
For iCount = 0 To iList.Max
  iSum += iList[iCount]
  iPrd *= iList[iCount]
Next
 
Print "The Sum =\t" & iSum
Print "The Product =\t" & iPrd
 
End