C program to check whether a number is perfect or not using function

C program to check whether a number is perfect or not using function

Write a C program to check whether a number is perfect or not using function. 
That's a c program to find the perfect numbers using a function. Our c program finds perfect numbers in a given range using the function of any number you can give it. if you need a c program for perfect numbers between 1 and 1000 it also can be because it starts from 1 and then the user gives 1000. and also if your university says to write a c program to check whether the entered number is a perfect number or not. you can write this program. is created by a c program for a perfect number using for loop. this loop chacks its perfect number program in c or not. this is a program to accepts a number and checks whether the number is perfect or not that loop can not be run. 


#include 
void check(int number);
int main()
{
?int num, rem, sum = 0, i;
?printf("Enter a Number\n");
?scanf("%d", &num);
?check(num);
}
void check(int number)
{
?int rem, sum = 0, i;
?for (i = 1; i <= (number - 1); i++)
?{
?rem = number % i;
if (rem == 0)
?{
?sum = sum + i;
?}
?}
?if (sum == number)
?printf("Entered Number is perfect number");
?else
?printf("Entered Number is not a perfect number");
?return 0;
}