7. In a function that receives a value from the main function via a parameter and
then displays the parameter value on the screen, that parameter is considered
a. an input parameter
b. an output parameter
c. an input/output parameter
d. a stub
8. Given the prototype of a function:
void five(double x, double y, int *zp);
Given the following variable declarations, which calls to five are valid?
int m, n;
double p, q;
a. five(p, q, &n);
b. five(6.2, p, &m);
c. five(p, q, &m);
d. five(7.1, p, &q);
e. a and b only
f. a, b, c, and d
9. Given the following code fragment, what is the maximum valid subscript value for
array a?
#define MAX 50
int a[MAX];
a. 0
b. 49
c. 50
d. a[50]
e. none of the above
10. Which of the following conditions will be false (value of 0) after the execution
of the code fragment below?
int v[5] = {0, 0, 0, 0, 1};
int k, j;
j = 3;
while (j > 0) {
k = j;
while (k < 4) {
v[k] = v[k + 1] + 2;
++k;
}
--j;
}
a. v[0] == v[4]
b. v[1] == v[3]
c. v[0] < v[1]
d. v[1] < v[2]
e. v[2] < v[3]