Skip to content

Instantly share code, notes, and snippets.

@JeremyMorgan
Created July 8, 2013 18:31
Show Gist options
  • Save JeremyMorgan/5951266 to your computer and use it in GitHub Desktop.
Save JeremyMorgan/5951266 to your computer and use it in GitHub Desktop.
FizzBuzz in C++
#include<iostream>
#include<stdio.h>
int main (void)
{
int i;
for (i = 1; i <= 100; i++)
{
if (!(i % 15))
std::cout << "FizzBuzz \n";
else if (!(i % 3))
std::cout << "Fizz \n";
else if (!(i % 5))
std::cout << "Buzz \n";
else
printf("%d \n", i);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment