progs/collatz.while
author Christian Urban <urbanc@in.tum.de>
Sat, 13 Oct 2018 13:51:28 +0100
changeset 577 7a437f1f689d
parent 147 4725bba8ef26
permissions -rw-r--r--
updated

write "Input a number ";
read n;
while n > 1 do {
  if n % 2 == 0 
  then n := n/2 
  else n := 3*n+1;
};
write "Yes";