#include<stdio.h>
#include<conio.h>
void main()
{
int num,i,sum=0;
clrscr();
printf("\n enter the number");
scanf("\n %d",&num);
for(i=1;i<num;i++)
{
if(num%i==0)
{
sum=sum+i;
}
}
if(num==sum)
{
printf("\n number is perfect");
}
else
{
printf("\n number is not perfect");
}
getch();
}
#include<conio.h>
void main()
{
int num,i,sum=0;
clrscr();
printf("\n enter the number");
scanf("\n %d",&num);
for(i=1;i<num;i++)
{
if(num%i==0)
{
sum=sum+i;
}
}
if(num==sum)
{
printf("\n number is perfect");
}
else
{
printf("\n number is not perfect");
}
getch();
}