i have recently started to learn c programming and im trying to improve my skill.i have some question about perfect numbers i searched forum but results were about C++.
question is this code finds perfect numbers between 1 to 1000000. but its not working after 8128 which is perfect number.
#include<stdio.h>
#include<conio.h>
int main (void)
{
int i,j,sum;
for(i=1;i<=1000000;i++)
{
j=1;
sum=0;
while(j<i)
{
if(i%j==0)
sum=sum+j;
j++;
}
if(sum==i)
printf("%d\n",i);
}
getch();
}