diff options
Diffstat (limited to 'examples/fizzbuzz.c')
| -rw-r--r-- | examples/fizzbuzz.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/fizzbuzz.c b/examples/fizzbuzz.c new file mode 100644 index 0000000..c24ce89 --- /dev/null +++ b/examples/fizzbuzz.c @@ -0,0 +1,14 @@ +int printf(const char*, ...); + +int main() { + for (int i = 1; i <= 100; i++) { + if (i % 15 == 0) + printf("FizzBuzz\n"); + else if (i % 3 == 0) + printf("Fizz\n"); + else if (i % 5 == 0) + printf("Buzz\n"); + else + printf("%d\n", i); + } +} |
