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
postfix expression for x^y^z-m+n+p/q ?
I think it is 65% in 10th, 12th n BE with a 5% relaxation in any one. For west bengal bord..what will be simple average for HS...is the additional marks would be adde with 100+200=1200.and the the average will be done. OR it will be treated 65% if somebody gets 650 in HS.? Please reply for this question......... And what is the marks criteria for infosys for experienced employee.
why does the array will be start on size 0?
wats the difference between RS latch using NAND n NOR gate? which is to be preffered?
what in 4th and 5th normal form ??
how the class is instance of object?
I APPLIED SBIPO EXAM PLZ SEND ME THE INTERVIEW QUESTIONS AND GD TOPICS AND WRITTENEXAM QUESTIONS
describe how your code can determine if the user entered an input box value or click the cancel button?
what is the differance between a technology and an engineering ?
what is the working of tcp/ip?
i opt cse branch in engineering.which subject i have choose in civil service preliminary examination
how we can improve mobile ad,hoc network.
can anyone help me with an article or a few pointers on what are the industry expectations from Fresh engineers in today's market scenario
PLZ SOMEONE TELL ME WHICH TYPE OF QUESTIONS IS ASKED IN HLL(Hindustan latex ltd.)mangmt trainee entrance exam?
what is difference between semaphre and deadlock