write an algorithm to find all the divisor of a number
Answers
Answered by
1
Answer:
For that, you can use an algorithm which takes advantage of the fact that sqrt(N^2) = N. This means that if you loop from i = 1 to int(sqrt(N)) you can find all the divisors like this: If i divides N, then it's a divisor. Then, you can also add to the list the value N/i, which will also be a divisor
Similar questions