(50 points) Write a programthat adds the first and last elements of an integer array and stored as the first element of the output array, adds the second and second-to-last elements and stored as the second number, and so on. If the array hasan odd number of integers, leave the central integer inthe original arrayunchanged.