Created
April 13, 2019 00:47
-
-
Save itsthedoc/e431a732c233786560f752007b0b6e2d to your computer and use it in GitHub Desktop.
PowerShell example for FizzBuzz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1..100) | % { | |
if (($_ % 5 -eq 0) -and ($_ % 3 -eq 0)) {"FizzBuzz"} | |
else { | |
if ($_ % 3 -eq 0) {"Fizz"} | |
elseif ($_ % 5 -eq 0) {"Buzz"} | |
else {$_} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment