Vidyalelo
C++ Programming · Q404

C++ miscellaneous

Programming · C++ Programming · question 404

Q404

What will be the output of the following C++ code? #include #include #include using namespace std; template class A T a; U b; public: A(T a_val, char b_val = ' ') this->a = a_val; this->b = b_val; void print() cout a1(5,10); A a2(5); A a3(10.0); return 0;

A.
5 10
5 $
10 $
B.
nothing
Answer
C.
Error
D.
Segmentation fault

Answer: Option B

Solution

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