|
|
|
|
|
|
|
12. Show the output of the following program. |
|
|
|
 |
|
|
|
|
#include <iostream.h>
void Test( int&, int );
int main()
{
int d;
int e;
d = 12;
e = 14;
Test(d, e);
cout << In the main function after the first call,
<< the variables equal << d << << e << endl;
d = 15;
e = 18;
Test(e, d) ;
cout << In the main function after the second call,
<< the variables equal << d << e << endl;
return 0;
}
void Test( int& s,
int t )
{
s = 3;
s = s + 2;
t = 4 * s;
cout << In function Test, the variables equal
<< s << << t endl;
} |
|
|
|
|
|
|
|
|
13. Number the marked statements in the following program to show the order in which they are executed (the logical order of execution). |
|
|
|
 |
|
|
|
|
#include <iostream.h>
void DoThis( int&, int& );
int main()
{
int number1;
int number2;
_____ cout << Exercise ;
_____ DoThis(number1, number2);
_____ cout << number1 << << number2 << endl;
return 0;
} |
|
|
|
|
|