-
What is the output of this program?
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
template <class type>
type Maximum(const type value1, const type value2)
{
cout << "No Specialization";
return value1 < value2 ? value2 : value1;
}
template <>
const char *Maximum(const char *value1, const char *value2)
{
return (strcmp(value1, value2) < 0) ? value2 : value1;
}
int main()
{
string S1 = "class", S2 = "template";
const char *value3 = "Interveiw";
const char *value4 = "Mania";
const char *q = Maximum(value3, value4);
cout << q << endl;
return 0;
}
-
- template
- class
- Interveiw
- Mania
- None of these
Correct Option: D
In this program, We are computing the result in the specialized block of the program.