Q59
What will be the output of the following C++ code? #include #include using namespace std; class A mutable int a; public: A() cout<<"A's default constructor called "; A(const A& a) cout<<"A's copy Constructor called "; ; class B A obj; public: B() cout<<"B's Constructor called "; ; int main(int argc, char const *argv[]) B b1; B b2;
A.
B's Constructor called
B's Constructor called
B's Constructor called
B.
B's Constructor called
A's default constructor called
B's Constructor called
A's default constructor called
A's default constructor called
B's Constructor called
A's default constructor called
C.
A's default constructor called
B's Constructor called
A's default constructor called
B's Constructor called
AnswerB's Constructor called
A's default constructor called
B's Constructor called
D.
A's default constructor called
B's Constructor called
A's copy Constructor called
B's Constructor called
A's copy Constructor called
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board