Subscribe & Get All Fresher Jobs Information & Study Materials PDF and Projects- Free Download
Data Structure Programs PDF
Pointers in C
Tech Interview in Datastructure
Data Structure Programming & Projects PDF- Free Download
TOWER OF HANOI
#include<stdio.h> void tower(int,char,char,char); void main() { int n; clrscr(); printf("\n\n\t\tTOWER OF HANOI\n\n"); printf("\n\n\tEnter the No. of Disk : "); scanf("%d",&n); if(n<1) printf("\n\tNO DISK TO MOVE\n\n"); else tower(n,'L','R','C'); getch(); } void tower(int n,char left,char right,char mid) { if(n>0) { tower(n-1,left,mid,right); printf("\nMove disk %d from %c to %c ",n,left,right); tower(n-1,mid,right,left); } }
Download All Data Structure Study Materials & ebook PDF