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