adding fizzbuz problem solution in C
authorElias Rodriguez <45079270+domielias@users.noreply.github.com>
Tue, 3 Nov 2020 20:35:21 +0000 (16:35 -0400)
committerElias Rodriguez <45079270+domielias@users.noreply.github.com>
Tue, 3 Nov 2020 20:35:21 +0000 (16:35 -0400)
fizzbuzz/c/domielias/FizzBuzz.c [new file with mode: 0644]

diff --git a/fizzbuzz/c/domielias/FizzBuzz.c b/fizzbuzz/c/domielias/FizzBuzz.c
new file mode 100644 (file)
index 0000000..8c8b374
--- /dev/null
@@ -0,0 +1,16 @@
+//Contributor: Domielias
+#include <stdio.h>
+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