#include<stdio.h>
void hanoi(int,char,char,char);
void main()
{
int n;
char A='A',B='B',C='C';
printf("Enter the number of Disks\n");
scanf("%d",&n);
printf("The Sequence is:\n");
hanoi(n,'A','B','C');
}
void hanoi(int n,char beg,char aux,char end)
{
if(n==1)
{
printf("The movement is %c->%c\n",beg,end);
}
else
{
hanoi(n-1,beg,end,aux);
printf("The movement is %c->%c\n",beg,end);
hanoi(n-1,aux,beg,end);
}}