Task

Compute the sum and product of an array of integers.




code CrLf=9, IntOut=11;
 
func SumProd(A, L);
int  A, L;
int  S, P, I;
[S:= 0;  P:= 1;
for I:= 0 to L-1 do [S:= S+A(I);  P:= P*A(I)];
IntOut(0, S);  CrLf(0);
IntOut(0, P);  CrLf(0);
]; \SumSq
 
SumProd([1,2,3,4,5,6,7,8,9,10], 10)