void transfer (int n, char from, char to, char temp)
{
if(n>0)
{
transfer(n-1, from,
temp, to);
printf(“\n Move disk %d from %c to %c”, n,
from, to);
transfer(n-1, temp, to, from);
}
}
No comments:
Post a Comment