Create a code in C on below details:
1) print out all data in the array with no more than 5 per line
2) print out the avg of the numbers
3) print out how many numbers are smaller than the avg
4) for every odd location in the array, subtract it from the previous even location and store results in the even location. print out all values in the array.
5) print out avg for the new array
6) swap the first number in the array with the last number in array and print out.
7) print out the average for new array.