Number k is a proper divisor of number n if k < n and k is a divisor of n. For example, 3 is a proper divisor of 6 and 5 is a proper divisor of 15.
A number n is perfect if the sum of the proper divisors of n is n. For example, the proper divisors of 6 are 1, 2 and 3. Since 1+2+3 = 6, 6 is a perfect number. Similarly, the proper divisors of 28 are 1, 2, 4, 7, and 14. Since 1+2+4+7+14 = 28, 28 is a perfect number.
Test your program. When it works, print it.
The modified program should read a number k from the user and print the first k perfect numbers. You will need to write a loop around the loop from the first assignment. Keep two different counters, one telling the number that you are currently testing for perfectness, the other telling how many perfect numbers have been printed. Put a comment in your program saying what each of those counters is for. Each time around the loop you will need to update the number that your are testing for perfectness. Only update the count of how many were printed when you print a number, and keep looping as long as you have printed fewer than k numbers.
Test your program. Only try printing the first 3 perfect numbers. (What is the third perfect number?) Print your program. Turn in both your first version and your second version together.