Monday, November 25, 2013

C code for Tower of Hanoi Problem.

#include "stdio.h"

void towers(int,char,char,char);

void towers(int n,char frompeg,char topeg,char auxpeg)
 { /* If only 1 disk, make the move and return */
     { printf("\nMove disk 1 from peg %c to peg %c",frompeg,topeg);
   /* Move top n-1 disks from A to B, using C as auxiliary */
   /* Move remaining disks from A to C */
   printf("\nMove disk %d from peg %c to peg %c",n,frompeg,topeg);
   /* Move n-1 disks from B to C using A as auxiliary */
 { int n;
   printf("Enter the number of disks : ");
   printf("The Tower of Hanoi involves the moves :\n\n");
   return 0;
OutPut IN TC is as follows:
Programming Geeks : Towers of Hanoi


  1. Please elaborate "What is / are Uninformed Search and Informed Search" With example or reference link/book.

  2. Please Elaborate "What is and are : Uninformed Search and Informed Search with example / reference link/ book."

  3. How can I get in touch of the author of this paper?

  4. How can I get in touch with the Author of this paper on ANN.


  5. This is great revealing content. Thank you I really appreciate the unique articles you write. makoprogram provide this
    Speech recognition programs like dragon

  6. Great post. I was once checking constantly this weblog and I'm impressed! Extremely useful information specially the closing part :) I maintain such information much. I was previously seeking this particular information for a lengthy time. Many thanks and best of luck. my sites:artificial intelligence program

  7. Privileged to read this informative blog on AI. Commendable efforts to put on research the data. Please enlighten us with regular updates on AI. Friends if you're keen to learn more about AI you can watch this amazing tutorial on the same.

  8. : Great blog. Your blog is so convincing that I never stop myself to say something about it. this is very informative and interesting for those who are interested to know What is Artificial Intelligence there is inspiration for us because we need it. You’re doing a great job, Keep it up. Artificial Intelligence is all about creating and developing machines it is very important to know what is it.
    Want more great blog : What is Artificial Intelligence