| changeset 894 | 4d5058706f1b |
| parent 893 | 908e4f6cdf7c |
| child 895 | 550676e542d2 |
| 893:908e4f6cdf7c | 894:4d5058706f1b |
|---|---|
1 // Find all factors of a given input number |
|
2 // by J.R. Cordy August 2005 |
|
3 |
|
4 write "Input n please"; |
|
5 read n; |
|
6 write "The factors of n are\n"; |
|
7 f := 2; |
|
8 while n != 1 do { |
|
9 while (n / f) * f == n do { |
|
10 write f; write "\n"; |
|
11 n := n / f |
|
12 }; |
|
13 f := f + 1 |
|
14 } |