Please expalin this c code Tower of hani puzzle with 4 peg and 8discs with a diagram i know the out put just draw diagram so that ican understand how recursive call works here
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int k;
void peg3(int n,char S,char D,char A1){
if (n == 1)
{
//if you access the value of s here just write s+1 instead of4
//here s = 3 for n=4 so i directly wrote 3+1=4
printf(“nMove disk 4 from peg %c to peg %c “, S, D);
return;
}
peg3(n-1, S, A1, D);
//here n+3 is actually n+s
printf(“nMove disk %d from peg %c to peg %c “, n+3, S, D);
peg3(n-1, A1, D,
PayPal Gateway not configured
PayPal Gateway not configured