Question

Describe an algorithm in pseudocode that returns the sum of positive integers (a1, a2, …, an) in a list.

EXPERT ANSWER

Steps for the pseudocode:

Algorithm to find the sum of positive integers in a list

Step 1 : start

Step 2 : declare variables sum=0, index =0, list

Step 3 : read values in list

Step 4 : take one list elements by using index

Step 5 : check the number is positive or not

Step 6 :if