1.

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

A. 4:
B. 4: 16BB:
C. 16BB:
D. 16BB: 4:
E. None of these
Answer» C. 16BB:


Discussion

No Comment Found

Related MCQs