1
0

post_pre.c 357 B

1234567891011121314
  1. /* post_pre.c -- postfix vs prefix */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. int a = 1, b = 1;
  6. int a_post, pre_b;
  7. a_post = a++; // value of a++ during assignment phase
  8. pre_b = ++b; // value of ++b during assignment phase
  9. printf("a a_post b pre_b \n");
  10. printf("%1d %5d %5d %5d\n", a, a_post, b, pre_b);
  11. return 0;
  12. }