Skip to the content.

Chapter 3: Control Flow

Exercises from “The C Programming Language” (2nd Edition) by Brian W. Kernighan and Dennis M. Ritchie.

Exercises

# Description Source
3-01 Binary search with single test inside loop -
3-02 escape(s, t): convert characters to escape sequences -
3-03 expand(s1, s2): expand shorthand like a-z -
3-04 itoa: handle largest negative number -
3-05 itob(n, s, b): convert n to base b string -
3-06 itoa with minimum field width -

Compilation

gcc -Wall -Wextra -o exercise exercise.c
./exercise