Hi, you haven't provided the programing language in which you need the code, I'll explain how to do it using Python, and you can follow the same logic to make a program in the programing language that you need.
Answer:
#Python
array = [5,2,3,4,5,0,7,1,9,8,2,7]
for i in range(len(array)-1):
array[i] = array[i]+array[i+1]
print(array)
Explanation:
First, we create an array, then a for loop that iterates from the beginning of the array to the penultimate value, this avoids changes in the last value of the array, we modify the array elements, except the last one, by adding the current element and the next element, finally, we print the result.