Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created Code for Day1 Challenge - FizzBuzz in C++ #344

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,16 @@
"doc",
"code"
]
},
{
"login": “swapnil-satpathy",
"name": “Swapnil Satpathy",
"avatar_url": "https://avatars2.githubusercontent.com/u/54858475?s=460&u=26d2adf4592c6517f58ac87edadf4eb3bc06edba&v=4",
"profile": "https://github.com/swapnil-satpathy",
"contributions": [
"doc",
Copy link
Contributor

Choose a reason for hiding this comment

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

You have not added your solution to the README markdown document, so your contribution only counts as code. Also, run the npm run contirbutors:generate command mentioned in the Contribution Guidelines so that your details are added to the CONTRIBUTORS markdown document.

"code"
]
}
]
}
40 changes: 40 additions & 0 deletions Day1/C++/fizzBuzzSwapnil.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

/*
Author: Swapnil Satpathy
Date: 03/10/2020

*/



#include <bits/stdc++.h>
using namespace std;



int main(){
cout<<"Please enter a number"<<endl;
int A;
cin>>A;

vector <string> soln;

for(int i=1;i<=A;i++){

if(i%3==0 && i%5==0)
soln.push_back("FizzBuzz");
else if(i%3==0)
soln.push_back("Fizz");
else if(i%5==0)
soln.push_back("Buzz");
else
soln.push_back(to_string(i));


}
for(int i=0;i<soln.size();i++)
cout<<soln[i]<<" ";
cout<<endl;

return 0;
}