|
|
|
|
|
|
|
3. For the program in Exercise 2, fill in the blanks with variable names to show the matching that takes place between the actual and the formal parameter lists in each of the two calls to the Test function. |
|
|
|
|
|
|
|
|
4. What is the output of the following program? |
|
|
|
 |
|
|
|
|
#include <iostream.h>
void Print( int, int );
int main()
{
int n;
n = 3;
Print(5, n);
Print(n, n);
Print (n * n, 12);
return 0;
}
void Print( int a,
int b )
{
int c;
c = 2 * a + b;
cout << a << << b c << endl;
} |
|
|
|
|
|
|
|
|
5. Using a reference parameter (passing by reference), a function can obtain the initial value of an actual parameter as well as change the value of the actual parameter. (True or False?) |
|
|
|
|
|
|
|
|
6. Using a value parameter, the value of a variable can be passed to a function and used for computation there, without any modification of the actual parameter. (True or False?) |
|
|
|
|
|
|
|
|
7. Given the declarations |
|
|
|
 |
|
|
|
|
const int ANGLE = 90;
char letter;
int number; |
|
|
|
|
|