Question: PART 1A (5 MARKS) 1. Consider the following declaration: int var = 4; //line 1 int *p; //line 2 ip = &var; //line 3 What
PART 1A (5 MARKS)
1. Consider the following declaration: int var = 4; //line 1 int *p; //line 2 ip = &var; //line 3 What does the statement in line 3 do?
A. declare a variable B. declare pointer variable C. store address of var in pointer variable D. assign the value in var which is 4 into pointer variable
2. A function header consists of the following components EXCEPT:
A. function name B. formal parameters C. actual parameters D. return value type
3. Which of the following is a VALID prototype for a function that receives an integer argument and returns a double value? A. int function(double); B. int function(double) C. double function(int); D. double function(int)
4. Which of the following is an advantage of passing an address of a variable to a function? A. The function can alter the original variable in the calling function B. The function can alter only one value, making it more secure C. You need to use no special notation when passing an address D. The function automatically makes a copy of the passed variable
5. What is the size of the array in the following C++ statement? double num[ ] = {5.5, 3.14,12.25, 6.7, 24.5}; A. Unknown B. Array index out of bounds error C. 5 D. 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
