RosettaCodeData/Task/Dot-product/XPL0/dot-product.xpl0
2023-07-01 13:44:08 -04:00

13 lines
191 B
Text

include c:\cxpl\codes;
func DotProd(U, V, L);
int U, V, L;
int S, I;
[S:= 0;
for I:= 0 to L-1 do S:= S + U(I)*V(I);
return S;
];
[IntOut(0, DotProd([1, 3, -5], [4, -2, -1], 3));
CrLf(0);
]