From e27c68c1bf40231f7092509ecdd0ad4f981ba050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Thu, 27 Aug 2015 22:01:44 +0200 Subject: [PATCH] Upload FizzBuzz.c does FizzBuzz from 1 - 100 --- FizzBuzz.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 FizzBuzz.c diff --git a/FizzBuzz.c b/FizzBuzz.c new file mode 100644 index 0000000..c6d6fd3 --- /dev/null +++ b/FizzBuzz.c @@ -0,0 +1,16 @@ +#include + +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); + } +}