Task

Compute the sum and product of an array of integers.




import system'routines;
import extensions;
 
public program()
{
    var list := new int[]{1, 2, 3, 4, 5 };
 
    var sum := list.summarize(new Integer());
    var product := list.accumulate(new Integer(1), (var,val => var * val));
}