An integer number is said to be a perfect number if its
factors, including 1 but not the number itself, sum to the
number. For example, 6 is a perfect number because 6 = 1 + 2
+ 3. Write a Java program, which finds and prints all
perfect numbers that are less than 1600.

Answer Posted / vinoliya rani.e

If the sum of the divisors exactly equals the number, the
number is called perfect.
For example, 15 has divisors 1, 3 and 5. If we add these
together, we get 1 + 3 + 5 = 9 which is less than 15, so 15
is a deficient number. On the other hand, 12 has divisors 1,
2, 3, 4 and 6. Adding these up gives 1 + 2 + 3 + 4 + 6 = 16
which is greater than 12, so 12 is an abundant number. The
number 6 has divisors 1, 2 and 3. Adding these gives 1 + 2 +
3 = 6, so 6 is a perfect number.

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want the syllabus of Section Enginner(Signal & Telecom) of RRB Exam

2401


what is means of admistrative distance

1596


minimum percentage in B.E in(INFORMATION TECHNOLOGY) to be eligible for IES exam qualification and also for reserved categories.are IT engineers are eligible for giving IES exams? please reply soon.

1938


WHAT IS THE DIff Between candidate key and primary key?

1419


why only j2me is used for mobile???

1548






Find the maximum stress intensity in the section?

1565


what is different between static block and public static void main??

1349


what is the formula/ ratio for hollow block? considering to a 40 kgs of portland cement.

1392


which/why unix commands are simpler rather than complex tasks

1998


What will be the sql query to list the employee names those are getting 3rd highest salary ?

1303


WHERE CAN I GET SQL SERVER NOTES SOFT COPY?

1341


Difference between software process model and software process.?

1497


I have Cleared Bank of India Clerical Examination.I just want to know how to prepare for interview and what are the parriculars that I have to submit......Pls someone help me with it

1493


what is the difference between physical address and logical address?

1526


what is the difference a zero argument constructor and a default constructor?

1581