ExamVeda
Login
Home
C plus plus miscellaneous
?

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
template <typename T, typename U>
void squareAndPrint(T x, U y)
{
    cout << x << x * x << endl;
    cout << y << " " << y * y << endl;
};
int main()
{
    int ii = 2;
    float jj = 2.1;
    squareAndPrint<int, float>(ii, jj);
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.