--- a/cwtests/cw02/factors.while Sat Dec 04 00:41:31 2021 +0000
+++ b/cwtests/cw02/factors.while Sat Dec 04 00:49:34 2021 +0000
@@ -1,11 +1,13 @@
// Find all factors of a given input number
-write "Input n please";
+write "Input n please: ";
read n;
-write "\nThe factors of n are";
+write "The factors of n are: \n";
f := 2;
while (f < n / 2 + 1) do {
- if ((n / f) * f == n) then { write(f); write("\n") } else { skip };
+ if ((n / f) * f == n)
+ then { write(f); write("\n") }
+ else { skip };
f := f + 1
}
\ No newline at end of file