#include
using std::cout;
using std::cin;
using std::endl;
template < class T >
T maximum( T value1, T value2, T value3 )
{
T maximumValue = value1;
if ( value2 > maximumValue )
maximumValue = value2;
if ( value3 > maximumValue )
maximumValue = value3;
return maximumValue;
}
int main()
{
int int1, int2, int3;
int1 = 1;
int2 = 2;
int3 = 3;
cout << "\nThe maximum integer value is: " << maximum( int1, int2, int3 );
double double1, double2, double3;
double1 = 1.1;
double2 = 2.2;
double3 = 3.3;
cout << "\nThe maximum double value is: "<< maximum( double1, double2, double3 );
char char1, char2, char3;
char1 = 'a';
char2 = 'b';
char3 = 'c';
cout << "\nThe maximum character value is: "<< maximum( char1, char2, char3) << endl;
return 0;
}
The maximum integer value is: 3
The maximum double value is: 3.3
The maximum character value is: c