#include<stdio.h>
#include<conio.h>
void
main()
{
int val,i,j=0;
clrscr();
printf("\n\n\tEnter the Number to
Check its Perfect or Not -> ");
scanf("%d",&val);
for(i=1; i<val; i++)
{
if(val%i==0)
{
j=j+i;
}
}
if(j==val)
{
printf("\n\n\t\tYour No
is Perfect No");
}
else
{
printf("\n\n\t\tYour No
is not a perfect no");
}
getch();
}
No comments:
Post a Comment