> Towers of Hanoi
This also suffers from having a non-recursive solution, using bit-manipulation of a binary counter:
max = 1 << no_of_discs;
for (x = 1; x < max; x++)
printf("move a disc from %d to %d\n", (x&x-1)%3, ((x|x-1)+1)%3);