Vidyalelo
C++ Programming · Q767

C++ miscellaneous

Programming · C++ Programming · question 767

Q767

What will be the output of the following C++ code? #include using namespace std; template class Test private: T val; public: static int count; Test() count++; ; template int Test ::count = 0; int main() Test a; Test b; Test c; cout ::count ::count << endl; return 0;

A.
2
1
Answer
B.
1
2
C.
1
1
D.
2
2

Answer: Option A

Solution

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