Task

Compute the sum and product of an array of integers.




class MAIN is
  main is
    a :ARRAY{INT} := |10, 5, 5, 20, 60, 100|;
    sum, prod :INT;
    loop sum := sum + a.elt!; end;
    prod := 1;
    loop prod := prod * a.elt!; end;
    #OUT + sum + " " + prod + "\n";
  end;
end;