For explanation watch video
Perfect Number :
In mathematics, a perfect number is a positive
integer that is equal to the sum of its positive divisors, excluding the number itself.
ex : 6 = 1,2,3 < 6
1+2+3 =6
ex: 5 : 1
sum = 1 !=5
5 is not perfect number
Perfect Numbers examples : 6,28,496,8128
Program to check given number is perfect or not:
#include
int main(){
int n;
printf("Enter the number: ");
scanf("%d",&n);
int sum = 0,i;
for(i=1;i