Skip to content

Commit 22802c9

Browse files
committed
Create fizzbuzz_number_game
1 parent 0e59573 commit 22802c9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

fizzbuzz_number_game

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Created by Jessica Joseph | 2015 05 May
2+
3+
A program for the FizzBuzz number game.
4+
If the number is a multiple of 3, "Fizz" is printed
5+
If the number is a multiple of 5, "Buzz" is printed
6+
If the number is a multiple of 3 and 5, "FizzBuzz" is printed
7+
Otherwise, the number is printed
8+
9+
for numb in 1...100 {
10+
if numb % 3 == 0{
11+
if numb % 5 == 0 {
12+
println("FizzBuzz")
13+
}
14+
println("Fizz")
15+
}
16+
else if numb % 5 == 0{
17+
println("Buzz")
18+
}
19+
else{
20+
println(numb)
21+
}
22+
}

0 commit comments

Comments
 (0)