Sketched out problem 4 in JfC

Short for "J for C programmers".