C Program Examples — Learn C by Example

C Programs — Learn by Example

91 K&R solutions, sorting algorithms, strings, file I/O — every program compiles and runs.

K&R Solutions (91)
All Programs

Sorting & Graph Algorithms

K&R Exercise Solutions — All 91

Every exercise from The C Programming Language 2nd ed. (Kernighan & Ritchie) — compile-verified, with full explanation.

Browse by Topic

About this site: C programs written to the ANSI C89 standard — every program compiles with gcc -ansi -Wall -Wextra with zero warnings. Started in 2011 to work through K&R; grown to 380+ programs covering algorithms, data structures, string handling, and file I/O.