Write a program in C++ using template to Display Values - WAY2IT

Latest Post :

Write a program in C++ using template to Display Values



Command to be Used :-

  • Template class

Code :-

#include<iostream.h>
#include<conio.h>
template <class T1, class T2>
void Function(T1 x, T2 y)
{
cout << x << "\t" << y << endl;
}
void main()
{
clrscr();
Function(10,20);
Function(10.5,12.5);
Function('I','J');
getch();
}



Output :-