progs/collatz.while
author Christian Urban <urbanc@in.tum.de>
Tue, 25 Sep 2018 21:57:14 +0100 (2018-09-25)
changeset 562 fa6d00968b0e
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";