---
# System prepended metadata

title: Untitled

---

507. perfect number
98 / 98 test cases passed.
Status: Accepted
Runtime: 1819 ms
Memory Usage: 5.7 MB

bool checkPerfectNumber(int num){
    int i=0;
    int total=0;
    for(i=1;i<=(num/2);i++){
        if((num%i)== 0)
            total+=i;
    }
    if(total==num)
        return true;
    else
        return false;
}