Skip to content

Instantly share code, notes, and snippets.

@d5884
Created February 20, 2010 02:53
Show Gist options
  • Save d5884/309466 to your computer and use it in GitHub Desktop.
Save d5884/309466 to your computer and use it in GitHub Desktop.
fizzbuzz
#include <stdio.h>
int main()
{
int i, five, three;
for (i = 1; i <= 100; i++) {
three = i % 3;
five = i % 5;
if (three == 0)
printf("Fizz");
if (five == 0)
printf("Buzz");
if (three != 0 && five != 0)
printf("%d", i);
putchar(' ');
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment