Question-55

Question-55

Which of the following algorithms can be used to find the sum of all the integers   in a list?

 

Solution

Procedure AddUp (a1,……….. , an : integers)

sum = a1

for i = 2 to n

sum = sum + ai

return sum

 

Leave a Reply