A perfect number is one for which the sum of its divisors (excluding the number) is equal to the number itself. For examples 6 is perfect since the three divisors of 6 (excluding 6) are 1, 2, and 3 which add up to 6. The number 8 however has divisors 1, 2, 4 which add up to 7 so 8 is not perfect.

Write a Java program that will determine and print the first 4 perfect numbers one per line.

6
Contributors
8
Replies
9
Views
8 Years
Discussion Span
Last Post by stultuske

Didn't your homework assignment include some resources to get you started?

It did. It included a very clear description of what's required.
The kid's classroom instruction and course documentation will contain everything else it needs except a mind.
IOW what we have here is just another lazy homework kiddo.

i need just some idea

i didnt ask to u ppl to solve my question but plz give me some idea to solve it

Another interesting type of number is known as a perfect number. A perfect number is one for which the sum of its divisors (excluding the number) is equal to the number itself. For examples 6 is perfect since the three divisors of 6 (excluding 6) are 1, 2, and 3 which add up to 6. The number 8 however has divisors 1, 2, 4 which add up to 7 so 8 is not perfect.

Write a Java program that will determine and print the first 4 perfect numbers one per line.

gys i need just some idea how to make it n i will solve it thn..