/*
  Working with boolean variables.
  
  A boolean can only be true (1) or false (0). true and false are values defined by the C++ compiler.
 
  See Nyhoff 111-116
*/

#include <iostream>
using namespace std;

int main()
{
   bool isTrue=true;                        
   bool isFalse=false;

// Negation
   bool whatami=!isTrue;                     // !  = not is negation
   cout << "whatami="  << whatami << endl;   // output: 0 (not true is false)

// Comparison equality     ==
   bool b= 2==2;                             // Note = is assignment, while == is comparison.
   cout << "b="  << b  << endl;              // output: 1 (true)

// Comparison smaller / larger   <= >= < >   
   double x=1.5, y=2.9;
   bool isSmaller= x<y;

   cout << "is " << x << "<" << y << "?   answer=" << isSmaller  << endl;              // output: 1 (true)
   
   return 0;
}
