Skip to content

Instantly share code, notes, and snippets.

@eli-oat
Created July 25, 2014 15:34
Show Gist options
  • Save eli-oat/1e70439d8f3895c7ccee to your computer and use it in GitHub Desktop.
Save eli-oat/1e70439d8f3895c7ccee to your computer and use it in GitHub Desktop.
FizzBuzz
void FizzBuzz() {
for(int i=1;i<=100;++i) {
bool printNum = true;
if(!(i%3)) {
std::cout << "Fizz";
printNum = false;
}
if(!(i%5)) {
std::cout << "Buzz";
printNum = false;
}
if(printNum)
{
std::cout << i;
}
std::cout << "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment