for (i=2; i<=100; i++)
{
for (n=1; n<=i; n++)
{if ((i%n) == 0)
sum=n+sum;
}
c=i+1;
if (sum == c)
System.out.println(i);}
}