5. (TCO 6) Given the following array declaration, if the array is stored startin
ID: 3645753 • Letter: 5
Question
5. (TCO 6) Given the following array declaration, if the array is stored starting at address 5000, what is the output of the following statement? Assume the code is for a 32 bit processor such as a Pentium.int data[25] = {0};
cout << &data[20] << endl;
a. 0.0
b. 5020
c. 5080
d. unknown
6.
(TCO 6) What does the following function do?
double calc ( double data[ ], int size )
{
double s = 0;
for(int i = 0; i < size; i++)
{
s += data[i];
}
return(s / size);
}
a. Returns the sum of all the values in the data array
b. Does nothing because the data array does not exist
c. Fails because the size of the array is not known
d. Returns the average of the values in the data array
Explanation / Answer
5.a 6.d
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.