Answer:
e) i++; should be interchanged with sum += arr[i];
Step-by-step explanation:
Since the purpose of the given code segment to find the sum of numbers in a given array, the logic implemented is in the while statement, observe that this line of code sum += arr[i]; is the same as sum = sum+arr[i], this is the statement that carries out the addition from the first element at index i to the last at index n-1. For this code to behave as intended, the summation should be done first before moving to the next element (i++). Interchanging the two lines of code (sum += arr[i], i++) solves this problem