solution/cw3/primes.while
changeset 894 4d5058706f1b
parent 893 908e4f6cdf7c
child 895 550676e542d2
--- a/solution/cw3/primes.while	Fri Oct 28 09:08:13 2022 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-// prints out prime numbers from
-// 2 to 100 (end)
-
-end := 100;
-n := 2;
-while (n < end) do {
-  f := 2;
-  tmp := 0;
-  while ((f < n / 2 + 1) && (tmp == 0)) do {
-    if ((n / f) * f == n) then  { tmp := 1 } else { skip };
-    f := f + 1
-  };
-  if (tmp == 0) then { write(n); write("\n") } else { skip };
-  n  := n + 1
-}
\ No newline at end of file