The main() Program
#include <stdio.h>
void hanoi(char A, char B, char C, int n);
main()
{
char A='A', B='B', C='C';
int n;
printf("\n\tHow many disks"
" initially on peg A? ");
scanf("%d", &n);
if(n < 1)
printf("\n\tThere's"
" nothing to move!\n");
else
hanoi(A, B, C, n);
}
Previous slide
Next slide
Back to first slide
View graphic version