#include<stdio.h>
int main( )
{
int n, i, j, sum=0;
printf("Enter the number");
scanf("%d",&n);
j=n;
for(i=1; i<n; i++)
{
if(n % i == 0)
sum=sum+i;
}
if(sum == j)
printf("%d is perfect number", j);
else
printf("%d is not perfect number", j);
return 0;
}
int main( )
{
int n, i, j, sum=0;
printf("Enter the number");
scanf("%d",&n);
j=n;
for(i=1; i<n; i++)
{
if(n % i == 0)
sum=sum+i;
}
if(sum == j)
printf("%d is perfect number", j);
else
printf("%d is not perfect number", j);
return 0;
}
0 Comments