
fizzbuzz
By: a guest on Aug 14th, 2010 | syntax:
C | size: 0.33 KB | hits: 43 | expires: Never
#include <stdio.h>
// This is kind of ridiculous. But the majority of
// developers can't get this right...
int main(int argc, char **argv) {
int i;
for (i = 1; i <= 100; i++) {
if ((i % 3) == 0) printf("Fizz");
if ((i % 5) == 0) printf("Buzz");
if ((i % 3) != 0 && (i % 5) != 0) printf("%i", i);
printf(" ");
}
}