To find the given no. is perfect no. (or) not

Program:

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
    int i, n, s = 0;
    clrscr() ;
    printf("Enter a number : ");
    scanf("%d", &n) ;
    for(i = 1 ; i < n ; i++)
    {
        if(n % i == 0)
        s = s + i;
    }
    if (s == n)
    printf("\n%d is a perfect number", n);
    else
    printf("\n%d is not a perfect number", n);
    getch();
}

Output:

Case: 1

Enter a number : 6
6 is a perfect number

Case: 2

Enter a number : 28
6 is a perfect number

Case: 3

Enter a number : 12
6 is not a perfect number