RosettaCodeData/Task/FizzBuzz/PowerShell/fizzbuzz-3.ps1
2026-04-30 12:34:36 -04:00

7 lines
154 B
PowerShell

1..100 | ForEach-Object {
$s = ''
if ($_ % 3 -eq 0) { $s += "Fizz" }
if ($_ % 5 -eq 0) { $s += "Buzz" }
if (-not $s) { $s = $_ }
$s
}