Home / MCQ Bank / Computer
Computer Plus Plus Miscellaneous

What will be the output of the following C++ code? #include <iostream> using namespace std; class BaseClass { protected: int i; public: BaseClass(int x) { i = x; } ~BaseClass() { } }; class DerivedClass: public BaseClass { int j; public: DerivedClass(int x, int y): BaseClass(y) { j = x; } ~DerivedClass() { } void show() { cout << i << " " << j << endl; } }; int main() { DerivedClass ob(3, 4); ob.show(); return 0; }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option B • 4 3

Related Computer Questions

Which characters is used to access property variables on an object-by-object basis? Performance analysis and tuning is which of the following? In C, what is a double pointer (int**)? Assets acquired for long term use in the business are called ________ To remove the content of selected cells you must issue ______ command