From 9c784daab306400f699e9889830630b9076a12b8 Mon Sep 17 00:00:00 2001 From: Elias Rodriguez <45079270+domielias@users.noreply.github.com> Date: Tue, 3 Nov 2020 16:35:21 -0400 Subject: [PATCH] adding fizzbuz problem solution in C --- fizzbuzz/c/domielias/FizzBuzz.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 fizzbuzz/c/domielias/FizzBuzz.c diff --git a/fizzbuzz/c/domielias/FizzBuzz.c b/fizzbuzz/c/domielias/FizzBuzz.c new file mode 100644 index 0000000..8c8b374 --- /dev/null +++ b/fizzbuzz/c/domielias/FizzBuzz.c @@ -0,0 +1,16 @@ +//Contributor: Domielias +#include +void isFizzBuzz(int number); + +int main(){ + for(int number=1;number<101;number++) + isFizzBuzz(number); +} +void isFizzBuzz(int number){ + if(number%3==0 && number%5==0) + printf("%d FizzBuzz\n",number); + else if(number%3==0) + printf("%d Fizz\n",number); + else if(number%5==0) + printf("%d Buzz\n",number); +} \ No newline at end of file -- 2.25.1