Task

Compute the sum and product of an array of integers.




int[] matriz = {1,2,3,4,5};
int suma = 0, prod = 1;
 
for (int p : matriz) {
  suma += p;
  prod *= p;
}
write("Sum = ", suma);
write("Product = ", prod);