progs/collatz.while
author cu
Tue, 31 Oct 2017 21:32:12 +0000
changeset 529 5c28e4134ee1
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";