1.

What is the output of this program?
#include <iostream>
using namespace std;
template <class T>
inline T square(T p)
{
T result;
result = p * p;
return result;
};
template <>
string square<string>(string str)
{
return (str+str);
};
int main()
{
int k = 4, kk;
string bb("A");
kk = square<int>(k);
cout << k << kk;
cout << square<string>(bb) << endl;
}

A. 164AA
B. AA416
C. 416AA
D. All of above
E. None of these
Answer» D. All of above


Discussion

No Comment Found

Related MCQs