04-18-2015, 07:59 AM
Code:
void FizzBuzz(int x) {
if (x % 3 == 0) // Or (!(x % 3))
printf("Fizz");
if (x % 5 == 0) // Or (!(x % 5))
printf("Buzz");
printf("\n");
return;
}
int main(void) {
for (int x=0;x=x+1;x<=10)
FizzBuzz(x);
return 0;
}
I'm taking it into another function, because grouping, and leaving out most unnecessary syntax, while keeping the returns. If I wanted to make it small, i'd inline it, use the alternative boolean if statement, and abuse argc.
I forget: does C now include constructs like x++; or ++x; ? I know they're in C++...