Jul-23-2018, 12:46 AM
You only need to check up to the square root of the number. But to do that, you need to append the factor you found (i (which is a bad variable name, use more descriptive names like 'factor' or 'possible')), and the number divided by the factor.
For example, checking factors of 16, you get 2 as a factor. You add that to the factors list, as well as 16 / 2 = 8.
For example, checking factors of 16, you get 2 as a factor. You add that to the factors list, as well as 16 / 2 = 8.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures