short indx;
short eval (int amt, int val)
{ if (amt > val)
return 0;
if (amt < val)
return 1;
return 2; ! equal
}
indx = eval(amount, x) * 3 + eval(amount, y);
switch (indx)
{ case 0: cout << "amt>x and amt>y"; break;
case 1: cout << "amt>x and amt<y"; break;
case 2: cout << "amt>x and amt=y"; break;
case 3: cout << "amt<x and amt>y"; break;
case 4: cout << "amt<x and amt<y"; break;
case 5: cout << "amt<x and amt=y"; break;
case 6: cout << "amt=x and amt>y"; break;
case 7: cout << "amt=x and amt<y"; break;
case 8: cout << "amt=x and amt=y"; break;
default:
}
cout << endl;