#include<stdio.h>
void perfect()
{
int n,i,sum;
for(n=1;n<=50;n++)
{
i=1;
sum = 0;
while(i<n)
{
if(n%i==0)
sum=sum+i;
i++;
}
if(sum==n)
printf("\t%d",n);
}
}
int main()
{
printf("Perfect Numbers Between 1 to 50\n\n");
perfect();
return 0;
}