HTML & JS
#include<stdio.h>
void towers(int num, char fromrod, char torod, char auxrod)
{
    if (num == 1)
    {
        printf("\n Move disk 1 from rod %c to rod %c", fromrod, torod);
        return;
    }
    towers(num - 1, fromrod, auxrod, torod);
    printf("\n Move disk %d from rod %c to rod %c", num, fromrod, torod);
    towers(num - 1, auxrod, torod, fromrod);
}
int main()
{
    int num=3;
    towers(num, 'A', 'C', 'B');
    return 0;
}

Generated URL:

Output:

 Move disk 1 from rod A to rod C
 Move disk 2 from rod A to rod B
 Move disk 1 from rod C to rod B
 Move disk 3 from rod A to rod C
 Move disk 1 from rod B to rod A
 Move disk 2 from rod B to rod C
 Move disk 1 from rod A to rod C
Report Bug