// TestInequalities.cpp
#include <iostream> // Console input and output
usingnamespace std;
#include "Inequalities.h"
int main()
{
// Prompt the user for input. Console output (cout)
// and input (cin)
double d1, d2;
cout << "Give the first number: ";
cin >> d1;
cout << "Give the second number: ";
cin >> d2;
char c; // Character type
cout << "Which function a) Max() or b) Min()? ";
cin >> c;
if (c == "a")
{
cout << "Max value is: " << Max(d1, d2) << endl;
}
else
{
cout << "Min value is: " << Min(d1, d2) << endl;
}
double dA = 1.0; double dB = 2.0; double dC = 3.0;
cout << "\ n\ nMax and min of three numbers: " << endl;
cout << "Max value is: " << Max(dA, dB, dC) << endl;
cout << "Min value is: " << Min(dA, dB, dC) << endl;
return 0;
}
I am using Visual Studio 2010 Express. There is a red line underneath the "==". When I mouse over this I get the message:
Error: Operand types are incompatible
I am working from a book I have bought and have made sure (100 times) that the code is exactly as it is in the book.
Do you have any suggestions as to what I have done wrong?