Skip to content

Commit b51225a

Browse files
gaurav01k3Aadit Kamat
and
Aadit Kamat
authored
Day-1 Solved (#336)
* Day-1 Solved * Fix conflict in CONTRIBUTORS.md Co-authored-by: Aadit Kamat <[email protected]>
1 parent 2da0ce3 commit b51225a

File tree

5 files changed

+124
-40
lines changed

5 files changed

+124
-40
lines changed

.all-contributorsrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,16 @@
298298
"contributions": [
299299
"code"
300300
]
301-
}
301+
},
302+
{
303+
"login": "gaurav01k3",
304+
"name": "GAURAV KUMAR",
305+
"avatar_url": "https://avatars0.githubusercontent.com/u/67451786?v=4",
306+
"profile": "https://github.com/gaurav01k3",
307+
"contributions": [
308+
"doc",
309+
"code"
310+
]
311+
}
302312
]
303313
}

CONTRIBUTORS.md

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

33
## Contributors
44

@@ -10,7 +10,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
1010
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
1111
| [<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") |
1212
| [<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") | | [<img src="https://avatars0.githubusercontent.com/u/25359325?v=4" width="100px;"/><br /><sub><b>Hrishikesh K Thakkar</b></sub>](https://github.com/Hrishikesh-Thakkar)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Hrishikesh-Thakkar "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Hrishikesh-Thakkar "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") | [<img src="https://avatars3.githubusercontent.com/u/33730790?v=4" width="100px;"/><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") | [<img src="https://avatars1.githubusercontent.com/u/40717067?v=4" width="100px;"/><br /><sub><b>Akshit Aggarwal</b></sub>](https://github.com/AkshitAggarwal)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=AkshitAggarwal "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=AkshitAggarwal "Code") | [<img src="https://avatars1.githubusercontent.com/u/44455626?v=4" width="100px;"/><br /><sub><b>Abhishek</b></sub>](https://github.com/dasabhishek0790)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=dasabhishek0790 "Code") | [<img src="https://avatars3.githubusercontent.com/u/63302439?v=4" width="100px;"/><br /><sub><b>SAGUN JAISWAL</b></sub>](https://github.com/sagunjaiswal)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=sagunjaiswal "Code") | [<img src="https://avatars0.githubusercontent.com/u/55596147?v=4" width="100px;"/><br /><sub><b>Abhishek Anantharam</b></sub>](https://github.com/abhishek0405)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=abhishek0405 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=abhishek0405 "Code") | [<img src="https://avatars3.githubusercontent.com/u/26011598?v=4" width="100px;"/><br/><sub><b>Prabhat Malhotra</b></sub>](https://github.com/malhotra1432)<br/>[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=malhotra1432 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=malhotra1432 "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") | [<img src="https://avatars3.githubusercontent.com/u/33730790?v=4" width="100px;"/><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") | [<img src="https://avatars1.githubusercontent.com/u/40717067?v=4" width="100px;"/><br /><sub><b>Akshit Aggarwal</b></sub>](https://github.com/AkshitAggarwal)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=AkshitAggarwal "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=AkshitAggarwal "Code") | [<img src="https://avatars1.githubusercontent.com/u/44455626?v=4" width="100px;"/><br /><sub><b>Abhishek</b></sub>](https://github.com/dasabhishek0790)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=dasabhishek0790 "Code") | [<img src="https://avatars3.githubusercontent.com/u/63302439?v=4" width="100px;"/><br /><sub><b>SAGUN JAISWAL</b></sub>](https://github.com/sagunjaiswal)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=sagunjaiswal "Code") | [<img src="https://avatars0.githubusercontent.com/u/55596147?v=4" width="100px;"/><br /><sub><b>Abhishek Anantharam</b></sub>](https://github.com/abhishek0405)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=abhishek0405 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=abhishek0405 "Code") | [<img src="https://avatars3.githubusercontent.com/u/26011598?v=4" width="100px;"/><br/><sub><b>Prabhat Malhotra</b></sub>](https://github.com/malhotra1432)<br/>[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=malhotra1432 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=malhotra1432 "Code") | [<img src="https://avatars0.githubusercontent.com/u/67451786?v=4" width="100px;"/><br/><sub><b>Gaurav Kumar</b></sub>](https://github.com/gaurav01k3)<br/>[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=gaurav01k3 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=gaurav01k3 "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!

Day1/C++/Day1_gaurav.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* @author: Gaurav Kumar <[email protected]>
3+
* @github: https://github.com/gaurav01k3
4+
* @date: 01/11/2020
5+
*/
6+
7+
#include <iostream>
8+
using namespace std;
9+
int main()
10+
{
11+
int n, i;
12+
cout << "Enter the no : ";
13+
cin >> n;
14+
// cout<<"\n";
15+
for (i = 1; i <= n; i++)
16+
{
17+
if ((i % 5 == 0) && (i % 3 == 0))
18+
{
19+
cout << "FizzBuzz\n";
20+
}
21+
else if (i % 3 == 0)
22+
{
23+
cout << "Fizz\n";
24+
}
25+
else if (i % 5 == 0)
26+
{
27+
cout << "Buzz\n";
28+
}
29+
else
30+
{
31+
cout << i << "\n";
32+
}
33+
}
34+
return 0;
35+
}

Day1/C++/Day1_gaurav.exe

50.7 KB
Binary file not shown.

Day1/README.md

Lines changed: 76 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,47 @@ public class Fizzbuzz {
109109
}
110110
}
111111
```
112+
### [Solution 2](./Java/FizzBuzzPrabhat.java)
113+
114+
```java
115+
/* @date 02/10/2020
116+
* @author Prabhat Malhotra
117+
*/
118+
119+
import org.junit.jupiter.api.Test;
120+
121+
/*
122+
* Solution
123+
*/
124+
public class FizzBuzzPrabhat {
125+
126+
public void fizzBuzz(int n) {
127+
for (int i = 1; i <= n; i++) {
128+
if (i % 3 == 0 && i % 5 == 0) {
129+
System.out.print("FizzBuzz,");
130+
} else if (i % 3 == 0) {
131+
System.out.print("Fizz,");
132+
} else if (i % 5 == 0) {
133+
System.out.print("Buzz,");
134+
} else {
135+
System.out.print(i + ",");
136+
}
137+
}
138+
}
139+
}
140+
141+
/*
142+
* Test
143+
*/
144+
class FizzBuzzPrabhatTest {
145+
@Test
146+
public void shouldPrintFizzBuzz() {
147+
FizzBuzzPrabhat fizzBuzzPrabhat = new FizzBuzzPrabhat();
148+
fizzBuzzPrabhat.fizzBuzz(20);
149+
}
150+
}
151+
```
152+
112153
## C Implementation
113154

114155
### [Fizzbuzz.c](./C/fizzbuzz.c)
@@ -481,51 +522,49 @@ export class FizzBuzz {
481522
// driver code
482523
const obj = new FizzBuzz();
483524
obj.solveFizzBuzzProblem(17);
484-
485-
```
486-
487-
## Java solution with Test
488525
```
489-
/* @date 02/10/2020
490-
* @author Prabhat Malhotra
491-
*/
492526

493-
import org.junit.jupiter.api.Test;
527+
## C++ Implementation
494528

495-
/*
496-
* Solution
497-
*/
498-
public class FizzBuzzPrabhat {
529+
### [FizzBuzz.cpp](./C++/FizzBuzz.cpp)
499530

500-
public void fizzBuzz(int n) {
501-
for (int i = 1; i <= n; i++) {
502-
if (i % 3 == 0 && i % 5 == 0) {
503-
System.out.print("FizzBuzz,");
504-
} else if (i % 3 == 0) {
505-
System.out.print("Fizz,");
506-
} else if (i % 5 == 0) {
507-
System.out.print("Buzz,");
508-
} else {
509-
System.out.print(i + ",");
510-
}
531+
```c
532+
'''
533+
* @author: Gaurav Kumar <[email protected]>
534+
* @github: https://github.com/gaurav01k3
535+
* @date: 01/11/2020
536+
'''
537+
#include <iostream>
538+
using namespace std;
539+
int main()
540+
{
541+
int n, i;
542+
cout << "Enter the no : ";
543+
cin >> n;
544+
// cout<<"\n";
545+
for (i = 1; i <= n; i++)
546+
{
547+
if ((i % 5 == 0) && (i % 3 == 0))
548+
{
549+
cout << "FizzBuzz\n";
550+
}
551+
else if (i % 3 == 0)
552+
{
553+
cout << "Fizz\n";
554+
}
555+
else if (i % 5 == 0)
556+
{
557+
cout << "Buzz\n";
558+
}
559+
else
560+
{
561+
cout << i << "\n";
562+
}
511563
}
512-
}
513-
}
514-
515-
/*
516-
* Test
517-
*/
518-
class FizzBuzzPrabhatTest {
519-
@Test
520-
public void shouldPrintFizzBuzz() {
521-
FizzBuzzPrabhat fizzBuzzPrabhat = new FizzBuzzPrabhat();
522-
fizzBuzzPrabhat.fizzBuzz(20);
523-
}
564+
return 0;
524565
}
525-
526566
```
527567

528-
529568
### Have Another solution?
530569

531570
The beauty of programming lies in the fact that there is never a single solution to any problem.

0 commit comments

Comments
 (0)