home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap03 / prepost.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-07  |  394 b   |  17 lines

  1. /* prepost.c -- shows effect of pre- */
  2. /*              and post-increments  */
  3. /*              and decrements       */
  4.  
  5. main()
  6. {
  7.     int b = 100;
  8.  
  9.     printf("b is %d\n", b);
  10.     printf("b++ is still %d\n", b++);
  11.     printf("but after it's used, ");
  12.     printf("b is incremented to %d\n\n, b);
  13.  
  14.     printf("++b, on the other hand, ");
  15.     printf("is immediately %d\n", ++b);
  16. }
  17.