Upload FizzBuzz.c
does FizzBuzz from 1 - 100
This commit is contained in:
parent
866bd5756f
commit
e27c68c1bf
16
FizzBuzz.c
Normal file
16
FizzBuzz.c
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user