Write a C++ program, which declares an array of ten (10)integers. This array is
ID: 3614472 • Letter: W
Question
Write a C++ program, which declares an array of ten (10)integers. This array is then passed to a function with the name“EvenTotal(…)”. The function“EvenTotal(…)” has following declaration:
int EvenTotal (int * ptrArray, int Size);
This function is called from main function. It takes the addressof first array element and size of array as arguments, it then usesa loop structure to calculate the sum of all the even integers inthe array, the sum is then returned to main function, which thenprints this number on console. E.g.
For the array:
int array[10]= {1,2,3,4,5,6,7,8,9,10}
It will print the following output:
Sum of Even Numbers: 30
Explanation / Answer
please rate - thanks #include using namespace std; int EvenTotal (int * ptrArray, int Size); int main() {int array[10]= {1,2,3,4,5,6,7,8,9,10}; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.