# include # include using namespace std; int main ( ) // // COMPARE compares two real numbers typed in by the user. // // It demonstrates how a user written function, in this case, // called "my_max", can be used to compare the numbers. // { double my_max ( double x1, double x2 ); double x, y, z; cout << "Enter two numbers to compare: "; cin >> x >> y; z = my_max ( x, y ); cout << "The maximum of " << x << " and " << y << " is " << z << "\n"; return 0; } double my_max ( double x1, double x2 ) { double x; if ( x1 < x2 ) { x = x2; } else { x = x1; } return x; }