Implementation
An (abstract) implementation might be:
int sum(int n, int x[]){
int s = 0;
int i = 0;
LOOP:
s = s + x[i];
i = i+1
if(i < n) goto LOOP
return s;
}
Previous slide
Next slide
Back to first slide
View graphic version