I'm not getting a compile error or warning, but the program seems to freeze while running the following function. As input, I send limcounter,
which is the number of actual values in the array (the user inputs values, and can stop input before filling the array, in which case the rest of the elements in the array are 0), and the array with the inputed values.
Does anyone know why it wouldn't be working right, I've stared at this for awhile and I'm stumped
Code:
int factorFind (int limcounter, int ary2 [])
{
//Declarations
int indic; //indicator that factor has been found
int counter2; //counter
int counter3; //counter
int factor; //calculated factor
int noindic; //indicator that there is no factor
//Statements
indic = 0;
noindic = 0;
factor = 1;
while ( indic == 0 )
counter3 = 0;
{
for ( counter2 = 0; counter2 <= ( limcounter - 1 ); counter2++ )
{
if ( factor % ary2[counter2] == 0 )
{
++counter3;
}
}
if ( counter3 == ( limcounter - 1 ) )
{
indic = 1;
}
else if ( counter3 == limcounter )
{
indic = 1;
noindic = 1;
}
else
{
++factor;
}
}
if ( noindic == 1 )
{
factor = 0;
}
return (factor);
} //factorFind