A perfect number is an integer p>1 such that the sum of the positive divisors of
ID: 3620217 • Letter: A
Question
A perfect number is aninteger p>1 such that the sum of the positive divisors of p equals p. For ex-
ample, 6 is a perfect number since 1+2+3 = 6; 28 is a perfect number since
1+2+4+7+14 = 28.
Write a complete C++ program in perfect.cc to write to standard output
all perfect numbers between 1 and a specied named constant LIMIT. For the
purposes of the assignment, set the value of LIMIT to 10000.
const int LIMIT = 10000;
I think we are only supossed to use while and if statements. I know it has to do with the % operation but everything i have been trying doesn't work.