What Is The Output Of The Following Programp Pre Langcpp #745
What is the output of the following program?</p> <pre><code class="language-cpp"> class A { protected: int a,b; public: void disp() { cout<<a<<b; } }; class B:public A { int x,y; }; </code></pre>
This multiple choice question (MCQ) is related to the book/course
gs gs111 OOP Object Oriented Programming Java.
It can also be found in
gs gs111 Inheritance & its Types - OOPs MCQ: Single Level Inheritance - Quiz No.2.
What is the output of the following program?
class A { protected: int a,b; public: void disp() { cout<<a<<b; } }; class B:public A { int x,y; };
Garbage value
Compile time error
Runtime error
Runs but gives random values as output