Question: Question 2 Write a Java program that reads two positive integers numi and num2 (assume numinum2). Then, the pro will display all perfect numbers between
Question 2 Write a Java program that reads two positive integers numi and num2 (assume numinum2). Then, the pro will display all perfect numbers between numi and num2. A positive Integer is called a perfect number if it is equal to the sum of all of its positive divisors, excluding itself. For example, 6 is the first perfect number because 6 = 3+2+1 The next is 28 = 14 +7+4+2+1 Hint: use modulus (%) to find the divisor of a number. Sample Input/Output Input the 2 numbers: 6 1001 Perfect Numbers are: 6 28 496 Note: Your answer should follow the given sample input/output. Use the editor to format your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
