progs/collatz.while
author Christian Urban <urbanc@in.tum.de>
Thu, 23 Mar 2017 14:49:26 +0000
changeset 481 acd8780bfc8b
parent 147 4725bba8ef26
permissions -rw-r--r--
merged

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";