Control Structures
These examples demonstrate loops and functions.
demo@linux:02_control_structures$ make
gcc -Wall -O3 -o loops loops.c
gcc -Wall -O3 -o functions functions.c
demo@linux:02_control_structures$ ./loops
while loop: 0
while loop: 1
while loop: 2
while loop: 3
while loop: 4
for loop: 0
for loop: 1
for loop: 2
for loop: 3
for loop: 4
another while loop: 0
another while loop: 1
another while loop: 2
leaving the while loop
1 is odd
3 is odd
i is 42
demo@linux:02_control_structures$ ./functions
two is even
three is odd
four isn't prime
5! = 120
6 choose 4 = 15