Consider the following example:
int max(int x, int y)
{
return ( x > y) ? x : y ;
}
float max(float x, float y)
{
return ( x > y) ? x : y ;
}
long max( long x, long y)
{
return ( x > y) ? x : y ;
}
char max(char x, char y)
{
return ( x > y) ? x : y ;
}
void main()
{
cout << max( 1,2) << endl;
cout << max( 4L,3L) << endl;
cout << max( 5.62,3.48) << endl;
cout << max('A','a') << endl;
}
The output is :
2
4
5.62
a