Program: Write a program in C++ that outputs all perfect numbers and their factors from 1 to 1000 using your own created function.
A Perfect number is when its factors not including the number itself sums to be the number.
EX. 6 because 6 = 1+2+3
Prepare a program to find out the perfect numbers and it must compile with no errors and follow the directions.