Amicable numbers

bool isAmicable(int start, int end)//you want to give it a range, but to check we need an actual number (third param
{
//220 and 284 are the smallest amicable numbers
for(int i = start; i <= end; i++)
{
for(int j = end; j >= start; j--)
{
if ((sumFactors(i)==j) && (sumFactors(j)==i) && (i != j)) //last conditional is important other wise it will return a same pair of numbers
{
cout << i << " and " << j << " are amicable\n";
return true;
}
}
}
cout << "No amicable values found in range: " << start << " - " << end << endl;
return false;
}
bool isAmicable(int start, int end)//you want to give it a range, but to check we need an actual number (third param
{
bool amicable = false;
//220 and 284 are the smallest amicable numbers
for(int i = start; i <= end; i++)
{
for(int j = end; j >= start; j--)
{
if ((sumFactors(i)==j) && (sumFactors(j)==i) && (i != j)) //last conditional is important other wise it will return a same pair of numbers
{
cout << i << " and " << j << " are amicable\n";
//return true;
amicable = true;
break;
}
}
}

The first { after the boolean expresion says there is an error i don't know why this is, could someone please help?
Please put your code in [code][/code] tags.

Please tell us what the error is.
Topic archived. No new replies allowed.