Skip to content

Commit 213fbdc

Browse files
rajashree23MadhavBahl
authored andcommitted
Day16 toh (#251)
* Add @rajashree23 as a contributor * Added tower of hanoi code in C
1 parent 882042d commit 213fbdc

File tree

4 files changed

+80
-6
lines changed

4 files changed

+80
-6
lines changed

.all-contributorsrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,16 @@
231231
"doc",
232232
"code"
233233
]
234+
},
235+
{
236+
"login": "rajashree23",
237+
"name": "Rajashree Parhi",
238+
"avatar_url": "https://avatars3.githubusercontent.com/u/33730790?v=4",
239+
"profile": "https://github.com/rajashree23",
240+
"contributions": [
241+
"doc",
242+
"code"
243+
]
234244
}
235245
]
236246
}

CONTRIBUTORS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors)
1+
[![All Contributors](https://img.shields.io/badge/all_contributors-23-orange.svg?style=flat-square)](#contributors)
22

33
## Contributors
44

55
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
66

77
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
88
<!-- prettier-ignore -->
9-
| [<img src="https://avatars2.githubusercontent.com/u/26179770?v=4" width="100px;"/><br /><sub><b>MADHAV BAHL</b></sub>](http://madhavbahl.tech/)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=MadhavBahlMD "Code") [📝](#blog-MadhavBahlMD "Blogposts") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=MadhavBahlMD "Documentation") [🎨](#design-MadhavBahlMD "Design") [✅](#tutorial-MadhavBahlMD "Tutorials") | [<img src="https://avatars2.githubusercontent.com/u/32531173?v=4" width="100px;"/><br /><sub><b>Rajdeep Roy Chowdhury</b></sub>](http://www.linkedin.com/in/razdeeproychowdhury)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Razdeep "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Razdeep "Documentation") [✅](#tutorial-Razdeep "Tutorials") | [<img src="https://avatars1.githubusercontent.com/u/16208722?v=4" width="100px;"/><br /><sub><b>Hrishi</b></sub>](https://hrishi1999.github.io)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Hrishi1999 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Hrishi1999 "Code") | [<img src="https://avatars1.githubusercontent.com/u/33101287?v=4" width="100px;"/><br /><sub><b>Bhanu Ailani</b></sub>](https://github.com/Bhanu0202)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Bhanu0202 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Bhanu0202 "Code") | [<img src="https://avatars3.githubusercontent.com/u/35690440?v=4" width="100px;"/><br /><sub><b>Deepak Sharma</b></sub>](https://sourcerer.io/dsdsharma)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=dsdsharma "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=dsdsharma "Code") | [<img src="https://avatars2.githubusercontent.com/u/28749866?v=4" width="100px;"/><br /><sub><b>Ramanpreet Singh</b></sub>](https://github.com/Ramanpreet6262)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Ramanpreet6262 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Ramanpreet6262 "Code") | [<img src="https://avatars1.githubusercontent.com/u/27620628?v=4" width="100px;"/><br /><sub><b>Anil Khatri</b></sub>](https://imkaka.github.io/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=imkaka "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=imkaka "Code") |
9+
| [<img src="https://avatars2.githubusercontent.com/u/26179770?v=4" width="100px;" alt="MADHAV BAHL"/><br /><sub><b>MADHAV BAHL</b></sub>](http://madhavbahl.tech/)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=MadhavBahlMD "Code") [📝](#blog-MadhavBahlMD "Blogposts") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=MadhavBahlMD "Documentation") [🎨](#design-MadhavBahlMD "Design") [✅](#tutorial-MadhavBahlMD "Tutorials") | [<img src="https://avatars2.githubusercontent.com/u/32531173?v=4" width="100px;" alt="Rajdeep Roy Chowdhury"/><br /><sub><b>Rajdeep Roy Chowdhury</b></sub>](http://www.linkedin.com/in/razdeeproychowdhury)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Razdeep "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Razdeep "Documentation") [✅](#tutorial-Razdeep "Tutorials") | [<img src="https://avatars1.githubusercontent.com/u/16208722?v=4" width="100px;" alt="Hrishi"/><br /><sub><b>Hrishi</b></sub>](https://hrishi1999.github.io)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Hrishi1999 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Hrishi1999 "Code") | [<img src="https://avatars1.githubusercontent.com/u/33101287?v=4" width="100px;" alt="Bhanu Ailani"/><br /><sub><b>Bhanu Ailani</b></sub>](https://github.com/Bhanu0202)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Bhanu0202 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Bhanu0202 "Code") | [<img src="https://avatars3.githubusercontent.com/u/35690440?v=4" width="100px;" alt="Deepak Sharma"/><br /><sub><b>Deepak Sharma</b></sub>](https://sourcerer.io/dsdsharma)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=dsdsharma "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=dsdsharma "Code") | [<img src="https://avatars2.githubusercontent.com/u/28749866?v=4" width="100px;" alt="Ramanpreet Singh"/><br /><sub><b>Ramanpreet Singh</b></sub>](https://github.com/Ramanpreet6262)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Ramanpreet6262 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Ramanpreet6262 "Code") | [<img src="https://avatars1.githubusercontent.com/u/27620628?v=4" width="100px;" alt="Anil Khatri"/><br /><sub><b>Anil Khatri</b></sub>](https://imkaka.github.io/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=imkaka "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=imkaka "Code") |
1010
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
11-
| [<img src="https://avatars0.githubusercontent.com/u/39827514?v=4" width="100px;"/><br /><sub><b>Ashwek Swamy</b></sub>](https://github.com/ashwek)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=ashwek "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=ashwek "Code") | [<img src="https://avatars1.githubusercontent.com/u/32368107?v=4" width="100px;"/><br /><sub><b>Dhruv Gupta</b></sub>](https://github.com/dhruv-gupta14)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=dhruv-gupta14 "Code") | [<img src="https://avatars0.githubusercontent.com/u/30969577?v=4" width="100px;"/><br /><sub><b>Aadit Kamat</b></sub>](https://sg.linkedin.com/in/aadit-kamat-12a5a8140)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=aaditkamat "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=aaditkamat "Code") | [<img src="https://avatars1.githubusercontent.com/u/20285786?v=4" width="100px;"/><br /><sub><b>Shashank jain</b></sub>](http://www.myshashank.tech)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Shashankjain12 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Shashankjain12 "Code") | [<img src="https://avatars3.githubusercontent.com/u/22260031?v=4" width="100px;"/><br /><sub><b>Moulik Aggarwal</b></sub>](https://github.com/moulikcipherX)<br />[💬](#question-moulikcipherX "Answering Questions") [📝](#blog-moulikcipherX "Blogposts") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=moulikcipherX "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=moulikcipherX "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/21277179?v=4" width="100px;"/><br /><sub><b>Prateek Surana</b></sub>](http://prateeksurana.me)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=prateek3255 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=prateek3255 "Code") | [<img src="https://avatars2.githubusercontent.com/u/43927436?v=4" width="100px;"/><br /><sub><b>shivank86</b></sub>](https://github.com/shivank86)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=shivank86 "Code") |
12-
| [<img src="https://avatars2.githubusercontent.com/u/25405726?v=4" width="100px;"/><br /><sub><b>Vishal Shirke</b></sub>](https://github.com/vishalshirke7)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=vishalshirke7 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=vishalshirke7 "Code") | [<img src="https://avatars1.githubusercontent.com/u/25369498?v=4" width="100px;"/><br /><sub><b>profgrammer</b></sub>](https://github.com/profgrammer)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=profgrammer "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=profgrammer "Code") | [<img src="https://avatars1.githubusercontent.com/u/26656036?v=4" width="100px;"/><br /><sub><b>divyakhetan</b></sub>](https://github.com/divyakhetan)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=divyakhetan "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=divyakhetan "Code") | [<img src="https://avatars0.githubusercontent.com/u/36483814?v=4" width="100px;"/><br /><sub><b>Spreeha Dutta</b></sub>](https://github.com/Spreeha)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Spreeha "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Spreeha "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/26464695?v=4" width="100px;"/><br /><sub><b>Chaitanya Bhojwani</b></sub>](https://github.com/chaitanya-bhojwani)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=chaitanya-bhojwani "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=chaitanya-bhojwani "Code") | [<img src="https://avatars0.githubusercontent.com/u/22885912?v=4" width="100px;"/><br /><sub><b>Manaswini Das</b></sub>](https://www.linkedin.com/in/manaswini-das/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=manaswinidas "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/25549847?s=460&v=4" width="100px;"/><br /><sub><b>Anirudh Jwala</b></sub>](https://www.linkedin.com/in/anirudh-jwala-533859135/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=anirudh-jwala "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=anirudh-jwala "Code") |
13-
| [<img src="https://avatars0.githubusercontent.com/u/2049543?v=4" width="100px;"/><br /><sub><b>Willian Taiguara Baliza Moura</b></sub>](https://github.com/willianwt)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=willianwt "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=willianwt "Code") |
11+
| [<img src="https://avatars0.githubusercontent.com/u/39827514?v=4" width="100px;" alt="Ashwek Swamy"/><br /><sub><b>Ashwek Swamy</b></sub>](https://github.com/ashwek)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=ashwek "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=ashwek "Code") | [<img src="https://avatars1.githubusercontent.com/u/32368107?v=4" width="100px;" alt="Dhruv Gupta"/><br /><sub><b>Dhruv Gupta</b></sub>](https://github.com/dhruv-gupta14)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=dhruv-gupta14 "Code") | [<img src="https://avatars0.githubusercontent.com/u/30969577?v=4" width="100px;" alt="Aadit Kamat"/><br /><sub><b>Aadit Kamat</b></sub>](https://sg.linkedin.com/in/aadit-kamat-12a5a8140)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=aaditkamat "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=aaditkamat "Code") | [<img src="https://avatars1.githubusercontent.com/u/20285786?v=4" width="100px;" alt="Shashank jain"/><br /><sub><b>Shashank jain</b></sub>](http://www.myshashank.tech)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Shashankjain12 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Shashankjain12 "Code") | [<img src="https://avatars3.githubusercontent.com/u/22260031?v=4" width="100px;" alt="Moulik Aggarwal"/><br /><sub><b>Moulik Aggarwal</b></sub>](https://github.com/moulikcipherX)<br />[💬](#question-moulikcipherX "Answering Questions") [📝](#blog-moulikcipherX "Blogposts") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=moulikcipherX "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=moulikcipherX "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/21277179?v=4" width="100px;" alt="Prateek Surana"/><br /><sub><b>Prateek Surana</b></sub>](http://prateeksurana.me)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=prateek3255 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=prateek3255 "Code") | [<img src="https://avatars2.githubusercontent.com/u/43927436?v=4" width="100px;" alt="shivank86"/><br /><sub><b>shivank86</b></sub>](https://github.com/shivank86)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=shivank86 "Code") |
12+
| [<img src="https://avatars2.githubusercontent.com/u/25405726?v=4" width="100px;" alt="Vishal Shirke"/><br /><sub><b>Vishal Shirke</b></sub>](https://github.com/vishalshirke7)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=vishalshirke7 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=vishalshirke7 "Code") | [<img src="https://avatars1.githubusercontent.com/u/25369498?v=4" width="100px;" alt="profgrammer"/><br /><sub><b>profgrammer</b></sub>](https://github.com/profgrammer)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=profgrammer "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=profgrammer "Code") | [<img src="https://avatars1.githubusercontent.com/u/26656036?v=4" width="100px;" alt="divyakhetan"/><br /><sub><b>divyakhetan</b></sub>](https://github.com/divyakhetan)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=divyakhetan "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=divyakhetan "Code") | [<img src="https://avatars0.githubusercontent.com/u/36483814?v=4" width="100px;" alt="Spreeha Dutta"/><br /><sub><b>Spreeha Dutta</b></sub>](https://github.com/Spreeha)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Spreeha "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Spreeha "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/26464695?v=4" width="100px;" alt="Chaitanya Bhojwani"/><br /><sub><b>Chaitanya Bhojwani</b></sub>](https://github.com/chaitanya-bhojwani)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=chaitanya-bhojwani "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=chaitanya-bhojwani "Code") | [<img src="https://avatars0.githubusercontent.com/u/22885912?v=4" width="100px;" alt="Manaswini Das"/><br /><sub><b>Manaswini Das</b></sub>](https://www.linkedin.com/in/manaswini-das/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=manaswinidas "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/25549847?s=460&v=4" width="100px;" alt="Anirudh Jwala"/><br /><sub><b>Anirudh Jwala</b></sub>](https://www.linkedin.com/in/anirudh-jwala-533859135/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=anirudh-jwala "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=anirudh-jwala "Code") |
13+
| [<img src="https://avatars0.githubusercontent.com/u/2049543?v=4" width="100px;" alt="Willian Taiguara Baliza Moura"/><br /><sub><b>Willian Taiguara Baliza Moura</b></sub>](https://github.com/willianwt)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=willianwt "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=willianwt "Code") | [<img src="https://avatars3.githubusercontent.com/u/33730790?v=4" width="100px;" alt="Rajashree Parhi"/><br /><sub><b>Rajashree Parhi</b></sub>](https://github.com/rajashree23)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=rajashree23 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=rajashree23 "Code") |
1414
<!-- ALL-CONTRIBUTORS-LIST:END -->
1515

1616
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!

day16/C/towerofhanoi.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
@author: rajashree23
3+
@date: 13/02/2019
4+
**/
5+
6+
7+
8+
9+
#include<stdio.h>
10+
11+
void TowerOfHanoi(int n, char source,char aux, char dest)
12+
{
13+
if(n==1)
14+
{
15+
printf("Move disk 1 from rod %c to rod %c\n", source,dest);
16+
return;
17+
}
18+
TowerOfHanoi(n-1,source,dest,aux);
19+
printf("Move disk %d from rod %c to rod %c\n",n,source,dest);
20+
TowerOfHanoi(n-1,aux,source,dest);
21+
22+
}
23+
int main()
24+
{
25+
int n;
26+
char source,auxilliary,destination;
27+
printf("Enter number of disks\n");
28+
scanf("%d",&n);
29+
TowerOfHanoi(n,'A','c','B');
30+
return 0;
31+
}

day16/README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ towerOfHanoi (3, 'A', 'C', 'B');
5656
* @author SPREEHA DUTTA
5757
*/
5858
import java.util.*;
59-
public class towersOfHanoi
59+
public class towersOfHanoi
6060
{
6161
public static void move(int n,char s,char d,char c)
6262
{
@@ -169,3 +169,36 @@ else:
169169
toh(num,'a','b','c')
170170
```
171171

172+
173+
###C Implementation
174+
175+
### [Solution](./C/towersofhanoi.C)
176+
```C
177+
/**
178+
@author: rajashree23
179+
@date: 13/02/2019
180+
**/
181+
182+
#include<stdio.h>
183+
184+
void TowerOfHanoi(int n, char source,char aux, char dest)
185+
{
186+
if(n==1)
187+
{
188+
printf("Move disk 1 from rod %c to rod %c\n", source,dest);
189+
return;
190+
}
191+
TowerOfHanoi(n-1,source,dest,aux);
192+
printf("Move disk %d from rod %c to rod %c\n",n,source,dest);
193+
TowerOfHanoi(n-1,aux,source,dest);
194+
195+
}
196+
int main()
197+
{
198+
int n;
199+
char source,auxilliary,destination;
200+
printf("Enter number of disks\n");
201+
scanf("%d",&n);
202+
TowerOfHanoi(n,'A','c','B');
203+
return 0;
204+
}

0 commit comments

Comments
 (0)