express.cpp 647 B

12345678910111213141516171819202122
  1. // express.cpp -- values of expressions
  2. #include <iostream>
  3. int main()
  4. {
  5. using namespace std;
  6. int x;
  7. cout << "The expression x = 100 has the value ";
  8. cout << (x = 100) << endl;
  9. cout << "Now x = " << x << endl;
  10. cout << "The expression x < 3 has the value ";
  11. cout << (x < 3) << endl;
  12. cout << "The expression x > 3 has the value ";
  13. cout << (x > 3) << endl;
  14. cout.setf(ios_base::boolalpha); //a newer C++ feature
  15. cout << "The expression x < 3 has the value ";
  16. cout << (x < 3) << endl;
  17. cout << "The expression x > 3 has the value ";
  18. cout << (x > 3) << endl;
  19. /// cin.get();
  20. return 0;
  21. }