Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Day1/C/fizzbuzz2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* @author: shashanknenar

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly fix the indentation for the comments in both the source code file as well as the README

* @date: 01/10/2020
*/


#include <stdio.h>

int main(void)
{
int i;
for (i=1; i<=100; i++)
{

if (i%15 == 0)
printf ("FizzBuzz\t");

else if ((i%3) == 0)
printf("Fizz\t");

else if ((i%5) == 0)
printf("Buzz\t");

else
printf("%d\t", i); //print
}

return 0;
}
36 changes: 35 additions & 1 deletion Day1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,40 @@ int main()
return 0;
}
```
### [fizzbuzz2.c](./C/fizzbuzz2.c)

```c
/*
* @author: shashanknenar
* @github: https://github.com/shashanknenar
* @date: 01/10/2020
*/

#include <stdio.h>

int main(void)
{
int i;
for (i=1; i<=100; i++)
{

if (i%15 == 0)
printf ("FizzBuzz\t");

else if ((i%3) == 0)
printf("Fizz\t");

else if ((i%5) == 0)
printf("Buzz\t");

else
printf("%d\t", i); //print
}

return 0;
}
```


## Python(3) Implementation

Expand Down Expand Up @@ -490,4 +524,4 @@ obj.solveFizzBuzzProblem(17);

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

In case you have an alternative way to solve this problem, do contribute to this repository (https://github.com/CodeToExpress/dailycodebase) :)
In case you have an alternative way to solve this problem, do contribute to this repository (https://github.com/CodeToExpress/dailycodebase) :)