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
what is far pointer?
How Main()is called by opreting system?
what is software engineer
discuss the technique for implementing high performance computing
Just a one miniute topics in English?
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
which/why unix commands are simpler rather than complex tasks
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
What is Landscape in Sap BW?
any one can help me to know the top mnc companies and their working platforms?i mean java,php...
what is the difference between oracle 8i and 9i. if someone could help me out.
What do you think determines a person's progress in a good company?
what does static variable mean in c language?
which field is comparitively very best , today and in future while considering the following : ELECTRONICS [OR] NETWORKING
WAP in Java to print the format: ABC BCD CDE EFG