Answer:
The solution code is written in Python
Explanation:
Firstly, create a sample number list, numList (Line 1)
Create a for-loop that will traverse through the array element from 0 till the second last of the element (len(numList) - 1) (Line 3)
Set the current element, numList[i], to the sum of the current element, numList[i] and the next element, numList[i+1]
Print the modified numList (Line 6) and we can see the output as follows:
[30, 50, 70, 40]