2012-03-23 22:17:52

Abel Gancsos
solve Tower of Hannoi with recursiion

void recursive(int x, char from,char to,char aux)
{
if(x==1)
{
printf("Move Disk %d From %c to %c",x,from,to);
}
else
{
recursive(x-1,from,aux,to);
printf("Move Disk %d From %c to %c",x,from,to);
recursive(x-1,aux,to,from);
}
}




TIP: REPLACE [] WITH STANDARD HYPERTEXT PROTOCOL.
TIP: REPLACE WHATEVER IS BETWEEN THE [] WITH YOUR INFORMATION.



Hope that helps!