#include<stdio.h>
int tower_of_hanoi(int no_of_disks, char source, char helper, char final)
{
if(no_of_disks == 1)
{
printf("\nMove Disk %d From %c To %c\n", no_of_disks, source, final);
return 0;
}
tower_of_hanoi(no_of_disks - 1, source, final, helper);
printf("Move Disk %d From %c To %c\n", no_of_disks, source, final);
tower_of_hanoi(no_of_disks - 1, helper, source, final);
return 0;
}
int main()
{
char source = 'A', helper = 'B', final = 'C';
int no_of_disks;
printf("\nEnter The Number of Disks:\t");
scanf("%d", &no_of_disks);
printf("\nSequence of Disks:\n");
tower_of_hanoi(no_of_disks, source, helper, final);
printf("\n");
return 0;
}