Here is an example C program to solve the Tower Of Hanoi problem...
main()
{
towers_of_hanio(n,'L','R','C');
}
towers_of_hanio(int n, char from, char to, char temp)
{
if(n > 0)
{
tower_of_hanio(n-1, from, temp, to);
printf("\nMove disk %d from %c to %c\n", n, from, to);
tower_of_hanio(n-1, temp, to, from);
}
}
Sunday, July 8, 2007
Subscribe to:
Post Comments (Atom)
4 comments:
thanks a lot
Super :)
Sample C Program To Accept A String & Display Number Of Vowels.
Sample C Program To Accept A String & Display Number Of Each Vowels.
Sample C Program To Accept A String & Find Out Whether This Character Is Present In The String.
Sample C Program To Find Out The No. Of Times A Character Is Present In The String.
Sample C Program To Understand Working Of Address Concept.
Sample C Program On Use Of Array & Pointer Concept Together.
Sample C Program On Pointers & 2 - Dimensional Array.
Sample C Program On Strings Into Array Of Pointers.
Sample C Program To Accept & Add Ten Numbers Using Pointers.
Sample C Program To Implement Recursive Algorithm Using Pointers.
Sample C Program With Algorithm To Implement Bubble Sort Using Pointers.
Sample C Program To Implement Selection Sort Using Pointers, Arrays & Functions.
It's awesome to visit this website and reading the views of all mates concerning this post, while I am also keen of getting experience.
Here is my page - Bmr calculator
Post a Comment