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
can u give me the information about the questions asked by the bally in campus
safety valve calculation?
What are the main differences between the engines in jet fighters and the engines in jet airliners; which type of engine is the more efficient, and (qualitatively) why?
what is the difference between public static void main (String args[]) and static public void main(String args[]) in java?
Why do sausages split lengthways, rather than around the circumference?
Please send the details and fee for Intools training course..I would like to do the course in second week of jUNE 2010.
Please if anybody have Vizag Steel Entrance exam papers or atleast Pattern of exam.Then please forward to my email- id: :srikanth.avanthi@gmail.com
what is difference between server 2008R1 and 2008 server R2?
What do you mean by component versionig?
I have Job A and Job B in jcl. I want to trigger Job B from Job A. Please advise.
performance test required for a automatic bank teller?
MY QUERY IS REGARDING AS/400. I AM FACING A PROBLEM IN UPDATING A PF COZ IT IS GETTING LOCKED SO I USED CHAIN(N) INSTEAD OF ONLY CHAIN.I ALSO TRIED UPDATE(E) ALONG WITH CHAIN(N),ITS NOT GIVING ANY ERROR BUT AT THE SAME TIME NOT UPDATING THE PF
what kind of wood is in high demand in india?
gsm features
Relate FDDI/ATM/SONET to the OSI model.