CPA-21-02 Web TestEngine demo

Exit VCEDump CPA-21-02 CPA - C++ Certified Associate Programmer
Question 13 of 39
0% complete
Q13 Single choice

What happens when you attempt to compile and run the following code?

#include <iostream>
#include <string>
using namespace std;
class A {
int x;
protected:
int y;
public:
int z;
};
class B : private A {
string name;
public:
void set() {
x = 1;
}
void Print() {
cout << x;
}
};
int main () {
B b;
b.set();
b.Print();
return 0;
}

Sign in to mark questions

Sign in to save marked questions and return to this demo.

Sign in