K&R C Chapter 4 Exercise Solutions — Functions and Program Structure
Chapter 4: Functions and Program Structure is where K&R builds a non-trivial program: a reverse Polish notation (RPN) calculator. The exercises extend it — adding modulo, unary minus, variables, and last-printed-value recall. Other exercises cover recursive printd, recursive itoa, and the C preprocessor. Exercise 4-12 (recursive itoa) and 4-13 (recursive reverse) are elegance tests. These …