#include<stdio.h>
int main()
{
int n,i,c=0;
printf("\nEnter a no:");
scanf("%d",&n);
for(i=1;i<n;i++)
{
if(n%i==0)
{
c=c+i;
}
}
if(n==c)
printf("\nPerfect no.");
else
printf("\nNot a perfect no.");
}
compzets
0
Newbie Poster
Recommended Answers
Jump to PostAnd more terrible code... Please stop posting just to boost your ego.
All 5 Replies
neeraj goswami
0
Newbie Poster
compzets
0
Newbie Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
compzets
0
Newbie Poster
cse.avinash
-1
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.