cwtests/cw02/collatz.while
changeset 833 aad5957eb7e4
child 856 23273e3a120f
equal deleted inserted replaced
832:a6e9fc38ae54 833:aad5957eb7e4
       
     1 write "Input a number ";
       
     2 read n;
       
     3 while n > 1 do {
       
     4   if n % 2 == 0 
       
     5   then n := n/2 
       
     6   else n := 3*n+1
       
     7 };
       
     8 write "Yes"