Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (anonymous):

how would you write the abundant odd numbers below 5000 in c++ P.S. abundant numbers are those whose sum of the divisors are more than the original

OpenStudy (anonymous):

How much have you tried doing so far? Is it that you need help determining whether numbers are abundant? Is it that you don't know how to check all of the numbers below 5000? I'd like to help, but I don't know what you're having trouble with.

OpenStudy (anonymous):

@dbean20 i would just like an explanation on how i would write the program would i use an if statement

OpenStudy (anonymous):

You have all the odd numbers below 5000 to go through. So you'll need a loop of some sort. Then you need to check if they're abundant. This means finding out what each of those numbers divides into evenly (you don't need to store them, but you do need to keep track of the total of those divisors). Then you need to check if that sum is higher than the original. This process requires another loop, and some if statements. So you need at least 2 loops and a few if statements. Do you think you're able to write the code that checks if a number is abundant?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!