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

what is far pointer?

1462


How Main()is called by opreting system?

1552


what is software engineer

1597


discuss the technique for implementing high performance computing

1033


Just a one miniute topics in English?

1317






what is the heat insulation material is adaptable for a flue gas duct that carries waste heat from brick kiln to brick drier and what temperature is required to maintain at the tunnel to dry adobe bricks adequately

1150


which/why unix commands are simpler rather than complex tasks

1978


A company canteen needs an automated system for its food and beverage management. The canteen receives food and beverage items from different distributors. All the non perishable items are stored in the store-room and the perishable items are put in the fridge. The manager should be able to add, delete or update food and beverage items onto the system and perishable and non perishable item details are to be stored separately. Both waiters and the cooks should be able to update the perishable items, but only the cooks should be allowed to update the non perishable items. Both cooks and waiters are not allowed to add or delete any items that are entered. identify the Schema, Table , Fields

2788


What is Landscape in Sap BW?

1657


any one can help me to know the top mnc companies and their working platforms?i mean java,php...

1402


what is the difference between oracle 8i and 9i. if someone could help me out.

1538


What do you think determines a person's progress in a good company?

11404


what does static variable mean in c language?

1806


which field is comparitively very best , today and in future while considering the following : ELECTRONICS [OR] NETWORKING

1429


WAP in Java to print the format: ABC BCD CDE EFG

2082