Which code, inserted at line 10, generates the output “2?

Which code, inserted at line 10, generates the output “2?1”?
#include #include using namespace std; class A { protected: int y; public: int z; };
//insert code here public: void set() { y = 2; z = 3;
}
void Print() { cout << y << z; } }; int main () { B b; b.set(); b.z = ?1; b.Print(); return 0; } B b; b.set(); b.z = ?1; b.Print(); return 0; } A. class B : private A {
B. class B : public A {
C. class B : protected A {
D. class B {

Download Printable PDF. VALID exam to help you PASS.

Posted in: CPA

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.