Question: 8. Consider the following code: #include #include using namespace std; const double E = 2.718; void computeExponential (const double inArr[], int size); int main()
8. Consider the following code: #include #include using namespace std; const double E = 2.718; void computeExponential (const double inArr[], int size); int main() { } = double expArray 1[] = (3.14, 5.5, 16.1); double expArray2 [] = {3, 5.7}; double expArray 3 [] (7.14, 42.5, 16}; computeExponential (expArray1, 3); computeExponential (expArray2, 2); computeExponential (expArray3, 3); return 0; void computeExponential (const double inArr [], int size) { static int count = 0; for(int i = 0; i < size; i++) { } } cout < < pow (E, inArr [i]) < < endl; count++; cout < < This function has been called " < < count < < "times." < < endl; (a) (3 pts) Identify any global variables. How do you know they are global? (b) (3 pts) What is the difference between the two uses of const in this code? (c) (3 pts) What is the value of count at the end? Why?
Step by Step Solution
3.46 Rating (159 Votes )
There are 3 Steps involved in it
a Identify any global variables How do you know they are global There are two global variables in th... View full answer
Get step-by-step solutions from verified subject matter experts
