Examples and exercises from K&R C, 2nd Edition