Computer Science, asked by tae301295, 1 day ago

Write a java program to check number is perfect
number or not using for loop. (Number is said to
be perfect number if sum of factors by excluding
number itself as factor is equal to number itself)

" WRITE INPUT, OUTPUT AND VARIABLE DESCRIPTION TABLE ALSO "​

Answers

Answered by abumohiuddin
0

Answer:

A number whose sum of factors (excluding the number itself) is equal to the number is called a perfect number. In other words, if the sum of positive divisors (excluding the number itself) of a number equals the number itself is called a perfect number. Let's understood it through an example

Explanation:

Let's take the number 496 and heck it is a perfect number or not.

First, we find the factors of 496 i.e. 1, 2, 4, 8, 16, 31, 62, 124, and 248. Let's find the sum of factors (1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 +248 = 496). We observe that the sum of factors is equal to the number itself. Hence, the number 496 is a perfect number. Similarly, we can check other numbers also

Similar questions