well all im trying to do is get the perfect factor from 1-100 so why the hell does this crash
and what is a boolean function since i am supposed to make IsPerfect() a boolean function
Code:
#include <iostream.h>
//-------------------------------------------------------------------
void IsPerfect()
{
int count,totalfactors,perfect=0;
for(count=0;count<=100;count++)
{
int count2;
totalfactors=0;
for(count2=0;count2<=count;count2++)
{
if(((count%count2)==0)&&(count!=count2))
{
totalfactors+=count2;
}
}
if(totalfactors==(count2+1))
{
perfect++;
}
}
cout<<totalfactors;
}
//-------------------------------------------------------------------
int main()
{
IsPerfect();
return (0);
}