C++ Programming :: Templates - Discussion
Home > C++ Programming > Templates > MCQs Questions Discussion
7 / 33
What is the output of the below C++ program?
#include < iostream >
#include < string >
using namespace std;
template < typename T >
void print_mydata(T output)
{
cout << output << endl;
}
int main()
{
double d = 5.5;
string s("Hello World");
print_mydata( d );
print_mydata( s );
return 0;
}
#include < iostream >
#include < string >
using namespace std;
template < typename T >
void print_mydata(T output)
{
cout << output << endl;
}
int main()
{
double d = 5.5;
string s("Hello World");
print_mydata( d );
print_mydata( s );
return 0;
}
A5.5
BHello World
CHello
Dnone of the mentioned
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!