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

HELLO ALL OF U.I HAVE QUALIFIED IN SBI CLERICAL WRITTEN EXAMINATION AND MY INTERVIEW IS ON 20TH OF THIS MONTH.IAM SOTWARE BACKGROUNDED CANIDIATE SO CAN ANY ANYBODY WHOSE INTERVIEW IS OVER CAN TELL ME THAT WHAT QUESTIONS THEY ASKED RELATING TO COMPUTER SCIENCE.

1396


What experience have you had in writing technical materials?

1589


4. What is your typical way of dealing with conflict?

1432


good morning! can u briefly explain the concept of syllolism and wat it mean?

2312


what's the difference between windows serevr 2003 or windows XP.

1651






Anyone have thesis paper about "Electrical Load Forecasting" . Or the web addresses where people usually upload their thesis paper except IEEE.

1390


what is domain functional level in windows server 2003?

1699


sir ,,kindly provide me 10 year old solved question papers of gate ,i am from CS. branch...

1615


question no. 4======Give a brief description of the following terms: a) Play head b) Symbol c) Tweening d) ActionScript e) Frame rate f) Library panel g) Masking h) Context – sensitive Property Inspector i) Bandwidth Profiler j) Frame Label

1446


what is the concept of c++ class

1474


performance test required for a automatic bank teller?

1517


Friends Any one tell me the best institute for the telecom protocol course

1571


what things abutsbi

1578


There are three bucket...Apple,Orange and Apple+Orange....On each Bucket one of the following labels are there..'A','O','A+O'...all this labels are not correctly patched on Bucket..identify which bucket contains What? You can not see bucket..u can pick any number of fruit from any basket...???

2242


difference between a for loop and a while loop? what are its uses in c language?

1554