Skip to content

Instantly share code, notes, and snippets.

@jtuttas
Created May 26, 2014 08:10
Show Gist options
  • Save jtuttas/09dfcfa6a68f4b67183e to your computer and use it in GitHub Desktop.
Save jtuttas/09dfcfa6a68f4b67183e to your computer and use it in GitHub Desktop.
do {
[int32]$zstart = read-host "Startzahl"
} while (($zstart % 2) -eq 0)
do {
[int32]$zende = read-host "Endezahl"
} while (($zende % 2) -eq 0)
[int32]$summe = 0
for ($i=$zstart+2;$i -le $zende -2;$i+=2) {
$summe+=$i
}
Write-host "Summe: $summe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment