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