Skip to content

Commit 2c4d342

Browse files
committed
fizzbuzz powershell
1 parent ae8ec08 commit 2c4d342

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: FizzBuzz/Powershell/Solution.ps1

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Function FizzBuzz ([int]$Number) {
2+
$Threes = $Number%3
3+
$Fives = $Number%5
4+
5+
if (($Threes -eq 0) -and ($Fives -eq 0)) {
6+
Write-Output "fizzbuzz"
7+
} elseif ($Threes -eq 0) {
8+
Write-Output "fizz"
9+
} elseif ($Fives -eq 0) {
10+
Write-Output "buzz"
11+
} else {
12+
Write-Output $Number
13+
}
14+
}

0 commit comments

Comments
 (0)