You're either using a C compiler or you're compiling under C mode in a C++ compiler. The problem is that you can't declare a variable in a for() under C.
Replace
for (int i=1;i<=oneNumber;i++)
{
if (oneNumber%i==0) // one factor found
{
countPositiveFactors++; // add 1 to count of positive factors
printf("%d ",i); // print this factor
sumPositiveFactors+=i; // add this factor e.g. i to the sum
prodPositiveFactors*=i; // multiply this factor with the previous factors
}
}
with this:
int i ;
for (i=1;i<=oneNumber;i++)
{
if (oneNumber%i==0) // one factor found
{
countPositiveFactors++; // add 1 to count of positive factors
printf("%d ",i); // print this factor
sumPositiveFactors+=i; // add this factor e.g. i to the sum
prodPositiveFactors*=i; // multiply this factor with the previous factors
}
}
And it should work.