Skip to content
Snippets Groups Projects
Select Git revision
  • 4162053f8b8ced13a1dc46cac7a9f2d338fade63
  • master default protected
  • develop
3 results

02_fundamentals

user avatar
Erik Strand authored
4162053f
History
Name Last commit Last update
..
.gitignore
Makefile
README.md
functions.c
loops.c

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