lesson 6 pre post c
[[lesson_6_pre_post_c]] last edit on
Aug 9, 2005
2:26 AM
by rescued_by_c
[user02@FC4 Lesson06]$ cat -n pre_post.c
[user02@FC4 Lesson06]$ ./pre_post
small_count is 0
small_count++ yields 0
small_count ending value 1
big_count is 1000
++big_count yields 1001
big_count ending value 1001
1 #include <stdio.h>
2
3 int main(void)
4 {
5 int small_count = 0;
6 int big_count = 1000;
7
8 printf("small_count is %d\n", small_count);
9 printf("small_count++ yields %d\n", small_count++);
10 printf("small_count ending value %d\n", small_count);
11
12 printf("big_count is %d\n", big_count);
13 printf("++big_count yields %d\n", ++big_count);
14 printf("big_count ending value %d\n", big_count);
15
16 return 0;
17 }
[user02@FC4 Lesson06]$ gcc -o pre_post pre_post.c[user02@FC4 Lesson06]$ ./pre_post
small_count is 0
small_count++ yields 0
small_count ending value 1
big_count is 1000
++big_count yields 1001
big_count ending value 1001