Vidyalelo
C++ Programming · Q1007

C++ miscellaneous

Programming · C++ Programming · question 1007

Q1007

What will be the output of the following C++ code? #include #include #include using namespace std; template class A public: A() cout a1; A a2; A a3; return 0;

A.
Created
Destroyed
Created
Destroyed
Created
Destroyed
B.
Created
Created
Created
Destroyed
Destroyed
Destroyed
Answer
C.
Destroyed
Created
Destroyed
Created
Destroyed
Created
D.
Destroyed
Destroyed
Destroyed
Created
Created
Created

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board