Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i, num, sum = 0;
- scanf("%d", &num);
- for(i=1; i<num; i++)
- {
- if(num%i == 0)
- {
- sum += i;
- }
- }
- if(sum == num)
- {
- printf("%d is PERFECT NUMBER", num);
- }
- else
- {
- printf("%d is NOT PERFECT NUMBER", num);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement