Computer Science, asked by Srijan07, 8 months ago

Write a program to check whether the number is perfect or not using DO-WHILE loop. (A number is said to be perfect if sum of all its factors (excluding itself) is equal to the number.) in java

Answers

Answered by sankarjitdutta1970
0

Explanation:

Any number can be a Java Perfect Number if the sum of its positive divisors excluding the number itself is equal to that number. For example, 28 is a perfect number because 28 is divisible by 1, 2, 4, 7, 14 and 28 and the sum of these values is 1 + 2 + 4 + 7 + 14 = 28. Remember, we have to exclude the number itself.

A perfect number is a positive integer that is equal to the sum of its proper positive divisors excluding the number itself. Enter any integer as an input. Now we use modulo operation along with loops and if conditions to check given number is a perfect number or not.

A number is a perfect number if is equal to sum of its proper ... sum of its positive divisors excluding the number itself. Write a function to check if a given number is perfect or not. ... Maintain sum of all divisors. ... while i * i < = n:...

please mark my answer as the brainliest...

please, please, please.............

Similar questions