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()
{
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...

If the condition of a for loop is false, then the flow is directed around the statements within it, and then redirected back to the condition, restarting the cycle.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The value of the controlling expression in a switch may be of type(s)

a. int b. int and char c. int and double d. char and double

Computer Science & Information Technology

If you’re using Photoshop for print pieces and Web ads, you would typically use ____-bit imagery.

a. 3 b. 8 c. 32 d. 64

Computer Science & Information Technology

_____ means translating business processes and functions into applications.

A. Forward engineering B. Limited perplexing C. Reverse engineering D. Boundless perplexing

Computer Science & Information Technology