Skip to content

Commit 84d4ace

Browse files
authored
Add Fizz Buzz in D (#4337)
1 parent a788a63 commit 84d4ace

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

archive/d/d/fizz_buzz.d

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

0 commit comments

Comments
 (0)