Write a new c++ program
- Declare an array of integers called arr, witha length of 10.
- Write a for loop to step through the array and make each arrayvalue equal to 2* its index. Print out each item inside that looptoo; the items should all be on the same line, separated byspaces.
- Also add up all the values in arr.
- Print the total.
Answer to Write a new c++ program Declare an array of integers called arr, with a length of 10. Write a for loop to step through t…