My notes and practice programs from learning C, organized by topic.
| Folder | Topics |
|---|---|
| 01-basics | Hello world, comments, escape sequences, identifier naming rules |
| 02-variables-and-data-types | Variables, constants, char / float / double / bool, sizeof, type conversion |
| 03-input-output | printf, scanf, reading user input |
| 04-operators | Arithmetic, assignment, comparison, logical, increment/decrement, ternary |
| 05-conditionals | if / else if / else, nested conditions, switch, leap year, vowel/consonant |
| 06-loops | for, while, do-while, nested loops, star patterns, break / continue |
| 07-practice-problems | Factorial, counting digits, sum of digits, reversing a number, palindromes |
| 08-arrays | Declaring and modifying arrays, array length with sizeof, traversal, average of elements |
| 09-2d-arrays | 2D arrays, traversing with nested loops, row/column count, matrix addition and subtraction |
| 10-strings | Strings as char arrays, the \0 null character, strlen / strcpy / strcat / strcmp |
| 11-functions | Intro to functions, summing numbers read with scanf |
Files named try-it-out-* are small exercises; *-practice files are practice problems.
Each .c file is a standalone program with its own main(). With GCC installed:
gcc 06-loops/for-loop.c -o build/for-loop
./build/for-loopCompiled output goes in build/, which is ignored by git.