Perfect
number : is a
positive integers
which
is equal to the sum of its proper positive divisors,
that is, the sum of its positive divisors excluding the number itself
(or)
Perfect
number : is a
positive integers
which
is equal to the sum of its proper positive factors,
that is, the sum of its positive factors
excluding the number itself
For
example
//C++ program to calculate perfect number
#include<iostream>Similar program(s) :
using namespace std;
int main()
{
int n,sum=0;
cout<<"Enter a number: ";
cin>>n;
for(int i=1;i<n;i++)
{
if(n%i==0)
sum+=i;
}
if(n==sum)
cout<<n<<" is a Perfect number"<<endl;
else
cout<<n<<" is not Perfect number"<<endl;
return 0;
}
C++ Program to find a given number is STRONG or not.















