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