adplus-dvertising
frame-decoration

Question

What is the output of this 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;
    }

a.

5.5 Hello World

b.

5.5

c.

Hello World

d.

None of the mentioned

Answer: (a).5.5 Hello World

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?