Created
July 25, 2014 15:34
-
-
Save eli-oat/1e70439d8f3895c7ccee to your computer and use it in GitHub Desktop.
FizzBuzz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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