C program to check whether a number is perfect or not

OUTPUT: