Hello all. I have this program where i am trying to figure out the factors of a given number through another file. But what i am having trouble with is adding up the number of factors that the number actually has. I have this so far:
int main()
{
int poss_digits, num_factors, num_primes, num_composites, num_neither;
int num = 0;
int factor = 0;
int count = 0;
int sum = 0;
while(cin >> poss_digits)
{
if (poss_digits > 0)
{
for(int i = 1; i <= num ; i++)
{
if(num % i == 0)
{
factor++;
sum = sum+i;
count++;
cout << sum;
}
}
}
return 0;
}