From: Elias Rodriguez <45079270+domielias@users.noreply.github.com> Date: Tue, 3 Nov 2020 20:35:21 +0000 (-0400) Subject: adding fizzbuz problem solution in C X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=9c784daab306400f699e9889830630b9076a12b8;p=langlearn%2F.git adding fizzbuz problem solution in 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