Practicing for Public Access Specifier of Object Oriented Programming

Questions 1 of 15
  • Q. Which among the following is true for the code given below?
    class A{
      int marks;
      public : disp(){
       cout<< marks;
      }
    }
    class B: protected A{
      char name[20];
    }
    A a; a.disp();
    B b; b.disp();