From 9ca65f8ff1b9b492bc434afd5cb7c568ee6b1989 Mon Sep 17 00:00:00 2001 From: Ravi Ranjan Date: Thu, 20 Oct 2022 12:06:00 +0530 Subject: [PATCH] Add Tower of Hanoi code --- CPP/recursion/tower_of_hanoi.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 CPP/recursion/tower_of_hanoi.cpp diff --git a/CPP/recursion/tower_of_hanoi.cpp b/CPP/recursion/tower_of_hanoi.cpp new file mode 100644 index 00000000..6c6fb48c --- /dev/null +++ b/CPP/recursion/tower_of_hanoi.cpp @@ -0,0 +1,18 @@ +#include +using namespace std; + +void T(int n,char A,char B,char C) +{ + if(n==1) + { + cout<<"Moved disk 1 from "<