• Advertisement

Archived

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

Finding the number of Divisors a integer has

This topic is 5943 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Could somebody please show me how to find the number of divisors an integer has? thank you, Scott Email Website
"If you try and don''t succeed, destroy all evidence that you tried."

Share this post


Link to post
Share on other sites
Advertisement
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

  • Advertisement