TOWERS OF HANOI

/* as this concept is not taught in class, it may be a bit difficult to understand it , i recommend you to watch some videos on youtube to understand the concept better
*/

#include <stdio.h>
void toh(int n, char LEFT, char RIGHT, char CENTER)
{
if(n>0)
{
toh(n-1, LEFT, CENTER, RIGHT);
printf("\n\tMove disk %d from %c to %c", n, LEFT, RIGHT);
toh(n-1, CENTER, RIGHT, LEFT);
}
}

void main()
{
int n;
printf("\nEnter no. of disks: ");
scanf("%d",&n);


printf("\nSOLUTION \n\t (L=Left,R=Right,C=Ceter)\n");
toh(n,'L','R','C');
}