Legend has it that long ago, a group of monks in the Far East were charged with the task of moving 64 golden discs from one pole to a third. Once this task was completed, the world would come to an end. However, the monks must follow a set of rules: no larger disc may be placed on top of a smaller disc. With those rules in mind, even if the monks move one disc per second, it will still take them 18446744073709551615 seconds to complete their task, which comes out to around 600 billion years.

Although the Towers Of Hanoi problem is usually used as an introduction to recursion, it's actually much better implemented iteratively:

#include<stdio.h>

void main()
{
  int i, x, max;
  printf("Number of discs?");
  scanf(" %d",&i);
  int max = 1 << i;
  for (x = 1; x < max; x++)
    { printf("Move a disc from %d to %d\n", (x & x-1) % 3, ((x | x-1) + 1) % 3); }
}
Quickest solution for three discs:

1 to 3; 1 to 2; 3 to 2; 1 to 3; 2 to 1; 2 to 3; 1 to 3