Skip to content

Commit 962003e

Browse files
authored
Add Fizz-Buzz in C* (#5161)
1 parent 540fe6c commit 962003e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

archive/c/c-star/fizz-buzz.cx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void main()
2+
{
3+
for (int i = 1; i <= 100; i++) {
4+
if (i % 15 == 0)
5+
println("FizzBuzz");
6+
else if (i % 3 == 0)
7+
println("Fizz");
8+
else if (i % 5 == 0)
9+
println("Buzz");
10+
else
11+
println(i);
12+
}
13+
}

0 commit comments

Comments
 (0)