#include <stdio.h>
int main() 
{
    int n,i=1,sum=0;
    scanf("%d",&n);
    printf("Enter the number:%d\n",n);
    while(i<n)
        {
            if(n%i==0);
            sum=sum+i;
            i++;
        }
    if(sum=n)
    {
        printf("The number is a PERFECT NUMBER");
    }
    else
    {
        printf("The number is not a PERFECT NUMBER");
    }
    return 0;  
    }
        

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: