progs/factors.while
changeset 659 15b69ca63b29
parent 658 a18e3c027c1f
--- a/progs/factors.while	Wed Oct 16 11:06:32 2019 +0100
+++ b/progs/factors.while	Wed Oct 16 11:14:53 2019 +0100
@@ -1,14 +1,14 @@
-// Find all factors of a given input number - J.R. Cordy August 2005
-var n;
+// Find all factors of a given input number
+// by J.R. Cordy August 2005
+
 write "Input n please";
 read n;
 write "The factors of n are";
-var f;
 f := 2;
-while n != 1 do
-    while (n / f) * f = n do
+while n != 1 do {
+    while (n / f) * f == n do {
         write f;
-        n := n / f;
-    end
-    f := f + 1;
-end
\ No newline at end of file
+        n := n / f
+    };
+    f := f + 1
+}
\ No newline at end of file