An integer number is said to be a perfect number if its factors, including 1 (bu
ID: 3551820 • Letter: A
Question
An integer number is said to be a perfect number if its factors, including
1 (but not the number itself), sum to the number. For example, 6 is a perfect number because 6 =1 + 2 + 3.
Write a function called perfect(NUM) that determines if parameter NUM is a perfect number. Use this function in a program that determines and prints all the perfect numbers between 1 and 1000.
Print the factors of each perfect number to confirm that the number is indeed perfect.
*Note: at the beginning program ask for the input NUM.