There wasn’t a link on the FizzBuzz Project page so I’m putting this here.
Here is one of my solutions to the FizzBuzz Project. I know it’s longer than the standard answer but I find it to be fun.
bool fizzBuzzed = false;
for (int i = 1; i <= 100; i++){
if (i % 3 == 0){
std::cout << "Fizz";
fizzBuzzed = true;
}
if (i % 5 == 0){
std::cout << "Buzz";
fizzBuzzed = true;
}
if (!fizzBuzzed){
std::cout << i;
}
std::cout << "\n";
fizzBuzzed = false;
}