Exit CPA-21-02 CPA - C++ Certified Associate Programmer
Question 3 of 5
0% complete
Q3 Single choice

What will the variable "age" be in class B?

class A {

int x;

protected:

int y;

public:

int age;

A () { age=5; };

};

class B : public A {

string name;

public:
B () { name="Bob"; };

void Print() {

cout << name << age;

}

};

  • A

    public

  • B

    private

  • C

    protected

  • D

    None of these