Skip to content

Instantly share code, notes, and snippets.

@stangirala
Created March 28, 2013 00:04
Show Gist options
  • Save stangirala/5259313 to your computer and use it in GitHub Desktop.
Save stangirala/5259313 to your computer and use it in GitHub Desktop.
FizzBuzz
#include <stdio.h>
int main() {
int i, j;
for (i = 1; i <= 100; i++) {
j = 0;
if (i % 3 == 0) {
printf("Fizz");
j = 1;
}
if (i % 5 == 0) {
printf("Buzz");
j = 1;
}
if (!j)
printf("%d", i);
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment