?
What will be the output of the following C++ code?
What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
template<class T>
T func(T a)
{
cout<<a;
return a;
}
int func(int a)
{
cout<<a;
}
int main(int argc, char const *argv[])
{
int a = 5;
int b = func(a);
float c = func(5.5);
return 0;
}
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
template<class T>
T func(T a)
{
cout<<a;
return a;
}
int func(int a)
{
cout<<a;
}
int main(int argc, char const *argv[])
{
int a = 5;
int b = func(a);
float c = func(5.5);
return 0;
}
Join the Discussion
Login to post a comment or share your explanation.
Login