Definitely one of the easier challenges, "FizzBuzz" is one of the most well known programming 'challenges' there is. If a number's divisible by 3, print "fizz" and if it's divisible by five, print 'buzz'. Else, print the number... Not really much more to say about this than "That took more time to describe than to actually program," but hey, it's one of the challenges, so here we are.
If you're on your dashboard, open this link... Trust me, it's a lot easier on the eyes:
// FizzBuzz on 7/6/16.
#include <iostream>
int main(int argc, const char * argv[]) {
for(int i = 0; i < 100; i++)
{
std::cout << i << ": ";
if(i != 0)
{
if(i %3 == 0)
std::cout << "Fizz";
if(i%5 == 0)
std::cout << "Buzz";
if(i%3 != 0 && i%5 != 0)
std::cout << i << " ";
}
std::cout<<std::endl;
}
return 0;
}
Side Note: Currently trying to figure out a theme that would allow me to put my code with proper programmin syntax. If you have a suggestion, I'd love to hear it out, but worst comes to worst, I can always do the CSS myself