
Everyday Problems 79
Program 53: Maximum Confusion
The
max
function is simple, the test code is simple, and the answer is . . . . Well,
you figure it out.
1 /************************************************
2 * test_max -- Test the max function. *
3 ************************************************/
4 #include <iostream>
5
6 /************************************************
7 * max -- return the larger of two integers. *
8* *
9 * Returns: *
10 * biggest of the two numbers. *
11 ************************************************/
12 const int &max(
13 const int &i1, // A number
14 const int &i2 // Another number
15 )
16 {
17 if (i1 > i2)
18 return (i1);
19 return (i2 ...