Archived

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

Nibbles

Finding the number of Divisors a integer has

Recommended Posts

krez    443
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 (krezisback@aol.com)

Share this post


Link to post
Share on other sites