Help with a C++ program

C

Cookiexide

Guest
Hey guys I need help with writing a program. I need to make a program that finds the integer from 1 to 1000 with the most divisors that produce no remainder. For example, the integer 60 has 12 divisors that produce no remainder.
They are 1,2,3,4,5,6,10,12,15,20,30,60.
Can anyone help? Thanks in advance!
 
Originally posted by Cookiexide
Hey guys I need help with writing a program. I need to make a program that finds the integer from 1 to 1000 with the most divisors that produce no remainder. For example, the integer 60 has 12 divisors that produce no remainder.
They are 1,2,3,4,5,6,10,12,15,20,30,60.
Can anyone help? Thanks in advance!

since I don't have a compiler on my system right now I will just try and give you the basics on what to do...

I don't know the extent of your coding knowledge so I will try and keep it as simple as possible...

first of my question would be do you have an input? or are you just compiling the proggy and once that is done it outputs the integers divisible with no remainder?

I would loop the proggy to do a from i <= 1000 do divide number (n or whatever you want to call it)... within that loop have error checking as in verify result.. so that if there is a decimal the value is thrown out, if not value is stored either in array or is output...

example of alogorithmic flow would be if val = certain criteria than cout (or store in array) else go to next i...

I mean there are a few ways to do this...

you are looking at a couple of loops and use of arrays seems to be a must to keep things nice and tidy...

sorry I was not more help :) extremely sleepy right now... in process of waking up...
 
Do you deal with Pocket PCs?

If so, I am looking for a NEW Dell Axim X5 Advance (that's the one with the 400Mhz Processor). What kind of price can you offer on this?
 
Originally posted by Un4gIvEn1
Do you deal with Pocket PCs?

If so, I am looking for a NEW Dell Axim X5 Advance (that's the one with the 400Mhz Processor). What kind of price can you offer on this?

I would recommend that you look @ the thread before you start posting...

:)
 
The number between 1 and 1000 that has the most divisors with no remainder? That's easy. :) It's 512 and 768.
The smallest divisor is 2. A number built up only by 2:s must be the smallest number with a specific number of divisors. 2^9 = 512. 9 divisors.
768 = 3*2^8. So that's also 9 divisors.
10 divisors, 2^10 = 1024 which is just to big.

No program needed. :)
 
Originally posted by Zedric
The number between 1 and 1000 that has the most divisors with no remainder? That's easy. :) It's 512 and 768.
The smallest divisor is 2. A number built up only by 2:s must be the smallest number with a specific number of divisors. 2^9 = 256. 9 divisors.
768 = 3*2^8. So that's also 9 divisors.
10 divisors, 2^10 = 1024 which is just to big.

No program needed. :)

lol... cardinal rule of programming... understanding the question before lurching into coding...

heh cheers zed :) teach me to be awake when I post...

:cool:
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back