Originally Posted by GAMEchief You don't have to end the line with every cout. Code: if (!(count % 3)) cout << "Fizz"; if (!(count % 5)) cout << "Buzz"; if (count % 3 || count % 5) cout << count; cout << endl; Also you don't need syntax highlighting to properly space your code. I did this in the quick reply box. Oh hey, that's a pretty good idea, just appending the buzz onto it if it needs it, or printing the number if it's neither, that's pretty sweet. +10lgg And yeah, good point about the formatting haha.
if (!(count % 3)) cout << "Fizz"; if (!(count % 5)) cout << "Buzz"; if (count % 3 || count % 5) cout << count; cout << endl;
Forum Rules