-
What is the output of this program?
#include <iostream>
using namespace std;
template <class type>
class Sample
{
public:
Sample()
{
};
~Sample()
{
};
type FunA(type num1)
{
return num1;
}
type FunB(type num2)
{
return num2;
}
};
int main()
{
Sample<int> num1;
Sample<double> num2;
cout << num1.FunA(250) << " ";
cout << num2.FunB(5.225);
return 0;
}
-
- 250
- 5.225
- 5.225 250
- 250 5.225
- None of these
Correct Option: D
In this program, We are passing the value and returning it from template.