Skip to content

Commit 8926afc

Browse files
authored
Add Fizz Buzz in Groovy (#4341)
1 parent 341617e commit 8926afc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

archive/g/groovy/FizzBuzz.groovy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
1.upto(100) {
2+
if (it % 15 == 0) {
3+
println("FizzBuzz")
4+
} else if (it % 5 == 0) {
5+
println("Buzz")
6+
} else if (it % 3 == 0){
7+
println("Fizz")
8+
} else {
9+
println(it)
10+
}
11+
};

0 commit comments

Comments
 (0)