Write the definition of a function AddUp(int Arr[ ], int N) in C++, in which all even positions (i.e. 0, 2, 4,….) of the array should be added with the content of the element in the next position and odd positions (i.e. 1, 3, 5,……) elements should be incremented by 10.
Example: if the array Arr contains
Then the array should become
Note:Then the array should become
- The function should only alter the content in the same array.
- The function should not copy the altered content in another array.
- The function should not display the altered content of the array.
- Assuming, the Number of elements in the array are Even.