This topic is now archived and is closed to further replies.


Finding the number of Divisors a integer has

Recommended Posts

do you mean factors?
just make a for loop that goes from 1 to the squareroot of the number you are finding the factors for...
say you are looking for factors of the integer N.
make your for loop use the integer I.
test each one to see if it is a factor (see if N mod I equals zero)... if it is, save it.
this will give you a list of all it''s factors.

--- krez (

Share this post

Link to post
Share on other sites