Find The Perfect Number In C++ Program

C++ program to find if a number is a perfect number or not. A Perfect number is one which the sum of all its divisors equals to the number.
For example 28 a Perfect Number since the sum of its divisors which are 1+ 2 + 4 + 7 + 14 = 28

Also Read: C++ Program To Find Roots Of a Quadratic Equation
                 C++ Program To Find Prime Numbers

int main()
int i,n,sum=0;
cout<<"enter a number";
for (i=1;i<n;i++)
  cout<<i<<"is a perfect number";
  cout<<i<<"is not a perfect number";
return 0;


Tech blogger, SEO expert, cryptocurrency enthusiast, and freelancer are the terms that describe me. I'll rather write a thousand words than speak hundred words, and that describes my passion as a content creator.