What is the output of the following code?

```
#include
using namespace std;

class Foo
{
public:
int x; // data field
int y; // data field

Foo()
{
x = 10;
y = 10;
}

void p()
{
int x = 20; // local variable
cout << "x is " << x << " ";
cout << "y is " << y << endl;
}
};

int main()
#include
using namespace std;

class Foo
{
public:
int x; // data field
int y; // data field

Foo()
{
x = 10;
y = 10;
}

void p()
{
int x = 20; // local variable
cout << "x is " << x << " ";
cout << "y is " << y << endl;
}
};

int main()
{
Foo foo;
foo.p();

return 0;
}
```

a. x is 20 y is 10
b. x is 10 y is 20
c. x is 20 y is 20
d. x is 10 y is 10

a. x is 20 y is 10

Computer Science & Information Technology

You might also like to view...

How does a mirrored volume function?

What will be an ideal response?

Computer Science & Information Technology

Match each term with the correct statement below.

A. A situation where either the likelihood or impact of an occurrence can be justified B. The assessment of the overall likelihood and impact of a threat C. An intrinsic weakness that is currently not exploited by a threat D. Representation of the risk environment using an approach such as data flow or UML E. Adversarial action that could cause harm or an undesirable outcome F. Confidence that a given approach will produce dependable and intended outcomes G. Electronic or behavioral actions designed to prevent or mitigate an adverse event H. The degree of likelihood and impact that is considered acceptable before a response is required I. A set of formal organizational processes that is designed to slow down or minimize the impact of an adverse event

Computer Science & Information Technology