+ 1

why m getting hearts and I in the output of this program of tower of hanoi

#include<stdio.h> #include<conio.h> void tof(int n,char source,char temp,char dest); void main() { int n;                /* n is the no. of disks*/ char a,b,c;           //source is a,temp is b, dest is c printf("enter the no. of disks\n"); scanf("%d",&n); tof(n,a,b,c); getch(); } void tof(int n,char source,char temp,char dest) { if(n==1) { printf("move the disk %d from %c to %c\n",n,source,dest); return; } tof(n-1,source,dest,temp); printf("move %d disks from %c to %c\n",n,source,dest); tof(n-1,temp,source,dest); }

12th Jul 2017, 3:36 PM
Gaurav Sharma
Gaurav Sharma - avatar
2 Respuestas
+ 2
what does this program do
12th Jul 2017, 4:21 PM
‎ ‏‏‎Anonymous Guy
0
it solves tower of hanoi
12th Jul 2017, 5:10 PM
Gaurav Sharma
Gaurav Sharma - avatar