Question: Consider the following code. Why would you get identifier not found errors? int main() { int num1 = 1; int num2 = 2; int total
Consider the following code. Why would you get identifier not found errors?
int main()
{ int num1 = 1; int num2 = 2; int total = 0; std::cout << "total = " << total << std::endl; total = addition(num1, num2); std::cout << "After addition(num1, num2), total = " << total << std::endl; }
int addition (int a, int b) { int r; r = a + b; return r; }
| A. Because the function call does not match the function definition. |
| B. Because variable a is not defined in the body of the even and odd functions. |
| C. Because the function is not declared prior to the function call. Their prototype is needed above main. |
| D. Because the variable i is not initialized to a valid integer value before it is used. |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
