The pseudocode below shows a function designed to calculate the sum of all even numbers up to a given limit, and call it within a main program.
1 FUNCTION sumEven(limit)
2 BEGIN FUNCTION
3 total = 0
4 IF limit < 2 THEN
5 total = 0
6 ELSE
7 FOR i FROM 2 TO limit STEP 2 DO
8 total = total + i
9 END FOR
10 END IF
11 RETURN total
12 END FUNCTION
13
14 OUTPUT "Enter limit: "
15 INPUT limitFromUser
16 ans = sumEven(limitFromUser)
17 OUTPUT "Total sum is: " + ans
Identify the line number where iteration starts.