Upload FizzBuzz.c

does FizzBuzz from 1 - 100
This commit is contained in:
Daniel Løvbrøtte Olsen 2015-08-27 22:01:44 +02:00
parent 866bd5756f
commit e27c68c1bf

16
FizzBuzz.c Normal file
View File

@ -0,0 +1,16 @@
#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);
}
}