Skip to content

564828/C-Program-to-Tower-of-Hanoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

#include<stdio.h>

#include<conio.h> int tower(int n,char beg,char aux,char end) { if(n==1) { printf("thed disk 1 is move from %c to %c\n",beg,end); return; } tower(n-1,beg,end,aux); printf("the disk %d is moved from %c to %c\n",n,beg,end); tower(n-1,aux,beg,end); } void main() { int num; printf("enter the number of disk \n"); scanf("%d",&num); tower(num,'A','B','C'); getch(); }

About

C programming tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published