Question: What best describes what the following function does? double yyy ( int vals[], int z) { for(int i = 1; i < z; i++) sum

What best describes what the following function does?

double yyy ( int vals[], int z) {

for(int i = 1; i < z; i++)

sum = sum + vals[i];

cout << sum / (z * 1.0);

}

computes the average of all array elements
computes the average of all array elements except for the first and the last
does nothing, the array has not been initialized
computes the average of all array elements except for the first

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!