|
|
 |
|
|
|
|
x = 15;
DoReference(x);
cout << x = << x << after the call to DoReference.
<< endl;
x = 16;
DoValue(x);
cout << x = << x << after the call to DoValue.
<< endl;
x = 17;
DoLocal();
cout << x = << x << after the call to DoLocal.
<< endl;
x = 18;
DoGlobal();
cout << x = << x << after the call to DoGlobal.
<< endl;
return 0;
}
void DoReference( int& a )
{
a = 3;
}
void DoValue( int b )
{
b = 4;
}
void DoLocal()
{
int x;
x = 5;
}
void DoGlobal()
{
x = 7;
} |
|
|
|
|
|
|
|
|
5. What is the output of the following program? |
|
|
|
 |
|
|
|
|
#include <iostream.h>
void Test();
int main()
{
|
|
|
|
|
|