home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / _DISK_ / ch2 / exrcse1.c < prev    next >
C/C++ Source or Header  |  2005-06-16  |  689b  |  26 lines

  1. /*               exrcse1.c
  2.  *
  3.  *   Synopsis  - Prints out values for several
  4.  *               expressions involving combinations
  5.  *               of relational operators.
  6.  *
  7.  *   Objective - To give practice with precedence
  8.  *               of the relational expressions.
  9.  */
  10.  
  11. /* Include Files */
  12. #include <stdio.h>
  13.  
  14. int main( void )
  15. {
  16.      int x = 4, y = 2;
  17.  
  18.      printf( "3<x<y has value %d.\n", 3<x<y );
  19.      printf( "x<3<y has value %d.\n", x<3<y );
  20.      printf( "3<x<1 has value %d.\n", 3<x<1 );
  21.      printf( "3<x<2 has value %d.\n", 3<x<2 );
  22.      printf( "3<(x=y) has value %d.\n", 3<(x=y) );
  23.      printf( "y=x<4 has value %d.\n", y=x<4 );
  24.      return 0;
  25.