Iterative Algorithm for Sum
Find the sum of the first num integers stored in an array v.
sum(v[ ]: integer array, num: integer): integer{
temp_sum: integer ;
temp_sum := 0;
for i = 0 to num – 1 do
temp_sum := v[i] + temp_sum;
return temp_sum;
}
Note the use of pseudocode