Task

Compute the sum and product of an array of integers.




import "/math" for Nums
var a = [7, 10, 2, 4, 6, 1, 8, 3, 9, 5]
System.print("Array   : %(a)")
System.print("Sum     : %(Nums.sum(a))")
System.print("Product : %(Nums.prod(a))")