I NEED HELP ASAP

I feel like this code is write but for some reason i am getting a sum in the int IsPerfect() function that are not even close.... the program is supposed to prompt a user for a number and return whether or not it is "True" a perfect number or "false" not a perfect number.

#include "genlib.h"
#include <iostream>
#include "simpio.h"

int IsPerfect(int n)
{
int sum;
sum==0
for (int i = 1; i <= (n/2.0); i++)
{
if ((n%i) == 0)
{
sum += i;
}
}
if(sum==n)
{
cout << "\nTrue";
}
else
{
cout << "\nFalse";
}
return sum;
}
int main()
{
int n;
cout << "Please enter a number you believe is a perfect number: ";
n = GetInteger();
IsPerfect(n);
return 0;
}
Where is GetInteger() defined?
In the 1st for loop magic 2.0 is a float or double but i is an int and n is an int......?
the program is supposed to prompt a user for a number

.......where is this input?
it prompts the user for input, i just figured it all out, was missing a }
Topic archived. No new replies allowed.