Question: JAVA 18. Perfect Number Write a Java program that takes two integer numbers, which are X and Y. Then, your program should find and output
JAVA

18. Perfect Number Write a Java program that takes two integer numbers, which are X and Y. Then, your program should find and output whether these numbers and the addition of these numbers is a perfect number. A perfect number is a number whose sum of the divisors is two times bigger than the number. Example: 28 divisors (1,2,4,7,14,28) 1+2+4+7+14+28=5656=282 ( 28 is a perfect number) Input Format For Custom Testing Sample Case 0 Sample Input For Custom Testing 6 28 Sample Output Enter number 1: 6 Enter number 2: 28 Number 1 is a perfect number Number 2 is a perfect number Their addition 34 is not a perfect number Explanation Sample Case 1 Sample Input For Custom Testing 8128 5 Sample Output Enter number 1: 8128 Enter number 2: 5 Number 1 is a perfect number Number 2 is not a perfect number Their addition 8133 is not a perfect number Explanation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
