Discussion :: C++ - MCQs
-
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;}
Answer : Option A
Explanation :
In this program, We are passing the value to the template and printing it in the template.
Be The First To Comment