-
What is the output of this program?
#include <iostream>
#include <string>
using namespace std;
template<typename T>
void Print_Data(T output)
{
cout << output << endl;
}
int main()
{
double var = 6.25;
string str("Hello Interview Mania");
Print_Data( var );
Print_Data( str );
return 0;
}
-
- Hello Interview Mania
- Hello Interview Mania
6.25 - 6.25
Hello Interview Mania - Compilation Error
- None of these
Correct Option: C
In this program, We are passing the value to the template and printing it in the template.