There was an error while loading. Please reload this page.
1 parent 0e59573 commit 22802c9Copy full SHA for 22802c9
fizzbuzz_number_game
@@ -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