We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd6d176 commit 102cdabCopy full SHA for 102cdab
fizz.c
@@ -0,0 +1,35 @@
1
+// Fizz.c is a program that prints the numbers from 1 to 100.
2
+// But for multiples of three print “Fizz” instead of the number
3
+// and for the multiples of five print “Buzz”.
4
+// For numbers which are multiples of both three and five print “FizzBuzz”.
5
+// Problem source: https://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/
6
+
7
+#include <stdio.h>
8
9
+int main(void)
10
+{
11
+ for (int i = 0; i < 100; i++)
12
+ {
13
+ if (i % 3 == 0 && i % 5 == 0)
14
15
+ printf("FizzBuzz\n");
16
+ }
17
18
+ if (i % 3 == 0)
19
20
+ printf("Fizz\n");
21
22
23
+ if (i % 5 == 0)
24
25
+ printf("Buzz\n");
26
27
28
+ else
29
30
+ printf("%i\n",i);
31
32
33
34
+ return 0;
35
+}
0 commit comments