progs/collatz.while
author cu
Thu, 28 Sep 2017 11:04:11 +0100
changeset 510 25580bf89ac0
parent 147 4725bba8ef26
permissions -rw-r--r--
typos

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