What is the output of the following code?

```
#include
using namespace std;

void f(double &p)
{
p += 2;
}

int main()
{
double x = 1;
double y = 1;

f(x);
f(y);

cout << "x is " << x;
cout << " y is " << y << endl;

return 0;
}
```

A. x is 2 y is 2
B. x is 1 y is 1
C. x is 1 y is 2
D. x is 3 y is 3
E. x is 2 y is 1

D. x is 3 y is 3

Computer Science & Information Technology

You might also like to view...

Linux passwords should be stored in the passwd file because the shadow file is world readable

Indicate whether the statement is true or false.

Computer Science & Information Technology

The loud clicking noise coming from a faulty hard drive is most likely created by:

A. the coil reversing polarity in an endless loop. B. one or more bad spindle motor bearings C. repeated motion of the read/write head armature parallel to the platter D. the solid state read/write head scratching the platter surface.

Computer Science & Information Technology