home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C03 / Boolean.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  819 b   |  27 lines

  1. //: C03:Boolean.cpp
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Relational and logical operators.
  7. #include <iostream>
  8. using namespace std;
  9.  
  10. int main() {
  11.   int i,j;
  12.   cout << "enter an integer: ";
  13.   cin >> i;
  14.   cout << "enter another integer: ";
  15.   cin >> j;
  16.   cout << "i > j is " << (i > j) << endl;
  17.   cout << "i < j is " << (i < j) << endl;
  18.   cout << "i >= j is " << (i >= j) << endl;
  19.   cout << "i <= j is " << (i <= j) << endl;
  20.   cout << "i == j is " << (i == j) << endl;
  21.   cout << "i != j is " << (i != j) << endl;
  22.   cout << "i && j is " << (i && j) << endl;
  23.   cout << "i || j is " << (i || j) << endl;
  24.   cout << " (i < 10) && (j < 10) is "
  25.        << ((i < 10) && (j < 10))  << endl;
  26. } ///:~
  27.