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 = float, int count = 3>
T multIt(T x)
{
    for(int ii = 0; ii < count; ii++)
    {
        x = x * x;
    }
    return x;
};
int main()
{
    float xx = 2.1;
    cout << xx << ": " << multIt<>(xx) << endl;
}

Answer & Solution
Correct Answer: Option C
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.