adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #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;
    }

a.

2.1

b.

378.228

c.

2.1: 378.228

d.

None of the mentioned

Answer: (c).2.1: 378.228

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?