Misc-small-projects/FizzBuzz.c
Daniel Løvbrøtte Olsen e27c68c1bf Upload FizzBuzz.c
does FizzBuzz from 1 - 100
2015-08-27 22:01:44 +02:00

17 lines
318 B
C

#include <stdio.h>
int main(void)
{
for(int i = 0; i < 100; i++)
{
if (i % 3 == 0 && i % 5 == 0)
printf("FizzBuzz\n");
else if (i % 3 == 0)
printf("Fizz\n");
else if (i % 5 == 0)
printf("Buzz\n");
else
printf("%i\n", i);
}
}