/*
Write a function of two parameters a and b of type float. The function 
is to return the maximum of a and b. Write a dtiver program to test your 
function. 
In the driver program, ask the user to enter three numbers and find 
their maximum by using the function.
*/
#include <iostream>
using namespace std;
float max(float a, float b);
int main()
{
	float a, b, c, d, e;
	cout << "Enter three real numbers: ";
	cin >> a >> b >> c;
	d = max(a,b);
	e = max(d,c);
	cout << "The maximum is: " << e << endl;
	///max(a,b); // WRONG
	//cout << "The maximum is: " << max(max(a,b),c) << endl;
	return 0;
}

float max(float a, float b)
{
	/*
	if (a > b)
		return a;
	else
		return b;
	*/

	/*
	float m;
	if (a > b)
		m = a;
	else
		m = b;
	return m;
	*/
	return ((a > b)? a : b);
}
