Duplicate values
Array sum program:
i := 0; s := 0;
while i ? n do
{ s := s+b[i]; i := i+1 }
b is unchanged inside loop
Problem: at loop head
–88 ? b[n – 1] ? 99
–556 ? sum(b) ? 539
Reason: more samples inside loop
Previous slide
Next slide
Back to first slide
View graphic version