I need to write a program that displays all perfect integers up to 100. I am required to write a boolean function, IsPerfect(), to use in the program.
A definition of perfect numbers: a number whose value is the sum of its divisors.Its not that Im asking for the code of my program neede...I essentially asking for an example of how Math Library is used. I wrote my assignment as an exmaple of the type of Math Library functions I am working with.You don't needany library functions. You only need the % operator to tell you when a potential divisor is in fact a divisor because it evenly divides into the number. That plus a loop or two and the ability to calculate a sum ought to do. Take a stab at it.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314