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 case, 6 is a perfect number because 6 =1 + 2 + 3.
Prepare 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 starting program ask for the input NUM.