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
learn maths and leave the fear of it
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