A printed reference, fully compiled

100 C programs.
Zero warnings.
Real output.

One book, start to finish: from printf("Hello, World!") to doubly linked lists, sorting, pointers, file I/O, and graphs — every single program compiled with gcc -Wall -Wextra and run for real before it went on the page.

100 programs 12 parts 0 warnings 94 pages 100% compiled & run
100 / 100
COMPILED
0 WARNINGS

Twelve parts, laid out in order

The book reads like a curriculum, not a reference dump — each part builds on the last, from your first printf to graphs traversed with BFS and DFS.

01 – 10
Foundations
Hello World, data types, operators, and every loop and branch C has.
11 – 18
Functions & recursion
Factorial, Fibonacci, GCD, call-by-reference, and variable scope.
19 – 28
Arrays, 1D and 2D
Search, matrix math, transpose, and sparse matrix representation.
29 – 38
Sorting algorithms
Bubble through radix and bucket sort — all ten, side by side.
39 – 48
Strings
Palindromes (string & number), anagrams, word frequency, tokenizing.
49 – 56
Pointers
Arithmetic, double pointers, function pointers, dynamic 2D matrices.
57 – 64
Structs, unions & enums
Nested structs, bit fields, typedef, and dynamic struct allocation.
65 – 70
File handling
Read, write, append, copy, and random access with fseek/ftell.
71 – 78
Console & keyboard control
Ctrl+key detection, arrow keys, ANSI text and background color.
79 – 82
ASCII & graphics
Shape plotting, Bresenham-style lines, and a real PPM image file.
83 – 96
Core data structures
Stacks, queues, every linked list, BSTs, binary trees, and graphs.
97 – 100
Capstone programs
Hash tables, expression evaluation, and a full contact database.

Real code. Real output.

Every entry follows the same format: the complete source on the left, the actual terminal result on the right — captured from a real compile, not written to look plausible.

program 01 · hello_world.c
/* Program 1: Hello World */
#include <stdio.h>

int main(void) {
    printf("Hello, World!\n");
    return 0;
}
$ ./hello_world
Hello, World!
$ 
program 41 · palindrome_string.c
int isPalindrome(const char *str) {
    int left = 0;
    int right = strlen(str) - 1;
    while (left < right) {
        if (tolower(str[left]) !=
            tolower(str[right]))
            return 0;
        left++; right--;
    }
    return 1;
}
$ ./palindrome_string
"madam" is a palindrome
"hello" is NOT a palindrome
"Racecar" is a palindrome
"level" is a palindrome
"world" is NOT a palindrome
$ 
program 81 · ppm_image.c
fprintf(fp, "P3\n%d %d\n255\n",
        WIDTH, HEIGHT);
/* diagonal gradient background, */
/* solid circle drawn by distance */
double dist = sqrt(
    (x-cx)*(x-cx) + (y-cy)*(y-cy));
if (dist <= radius) {
    r = 255; g = 80; b = 80;
}
$ ./ppm_image && open output.ppm
A red circle rendered on a gradient background, generated by the PPM image program using only C's standard file I/O — no graphics library.
200×200 image · no graphics library · pure stdio.h

How every entry is built

The same three-part structure repeats for all 100 programs, so once you know how to read one page, you know how to read the whole book.

01

A short explanation

One or two sentences on the concept the program demonstrates, and why it's built the way it is.

02

Complete source code

The full, unabridged .c file — nothing truncated, nothing left as an exercise.

03

Captured output

The exact result of compiling with gcc -Wall -Wextra and running the binary.

On Part 9 — keyboard control and color: programs that detect Ctrl+key combinations, arrow keys, or set terminal colors need a real interactive terminal to show their effect. They're complete, correct, and fully commented — run them yourself in any terminal to see the color and live key detection in action.