What Is The Output Of Following Program P Pre Langcpp #417

What is the output of following program? </p> <pre><code class="language-cpp"> template <typename T> void test(const T&x) { static int count = 0; cout << "x = " << x << " count = " << count << endl; ++count; return; } void main() { test<int> (2); test<int>(2); test<double>(2.2); } </code></pre>

Online Quiz This multiple choice question (MCQ) is related to the book/course gs gs111 OOP Object Oriented Programming Java. It can also be found in gs gs111 OOps Classes - Object Oriented Programming MCQ: Template Class - Quiz No.2.

What is the output of following program?

 template <typename T> void test(const T&x) { static int count = 0; cout << "x = " << x << " count = " << count << endl; ++count; return; }  void main() { test<int> (2); test<int>(2); test<double>(2.2); } 

Similar question(s) are as followings:



Online Quizzes of gs111 OOP Object Oriented Programming Java

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background