From 51083939794b4730d423e76d66f7cac8dc8581a6 Mon Sep 17 00:00:00 2001 From: Anup Kumar Panwar Date: Fri, 12 Aug 2016 15:44:31 +0530 Subject: [PATCH] Tower of Hanoi --- Tower of Hanoi.cpp | 94 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 Tower of Hanoi.cpp diff --git a/Tower of Hanoi.cpp b/Tower of Hanoi.cpp new file mode 100644 index 000000000..a432d3574 --- /dev/null +++ b/Tower of Hanoi.cpp @@ -0,0 +1,94 @@ +#include +using namespace std; + +struct tower +{ + int values[10]; + int top; +}F, U, T; + + + +void show() +{ + cout<<"\n\n\tF : "; + for(int i=0; i> no; + + for (int i = no; i >0; i--) + { + F.values[F.top++]=i; + }; + + + for (int i = (F.top)-1; i >=0; i--) + { + cout<=0; i--) + { + cout<<"\n"<