Skip to content

Instantly share code, notes, and snippets.

@jtuttas
Created September 5, 2014 12:24
Show Gist options
  • Save jtuttas/40cf175561b32da0fa25 to your computer and use it in GitHub Desktop.
Save jtuttas/40cf175561b32da0fa25 to your computer and use it in GitHub Desktop.
Oktalzahlen Wandlung
[int]$z=0
$out=""
while ($z -le 0) {
$z=Read-Host "Dezimalzahl:"
}
$dezimal=$z
while ($z -gt 0) {
$diff=$z%8
$out=$out.Insert(0,$diff)
$z=($z-$diff)/8
}
Write-Host ("Die Zahl $dezimal ist $out Oktal")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment