I must display the number of values that are above, equal to, and below the average, with "equal" being within a tolerance .01.
void RelToAve (double ave, int numRead, double *array)
{
int abo = 0, equ = 0, bel = 0, i;
for (i = 0; i < numRead; i++)
{
if (*array > ave)
abo++;
else if (*array < ave)
bel++;
else
equ++;
array++;
}
printf("\nAbove Average: %17i\n", abo);
printf("Equal to Average: %14i\n", equ);
printf("Below Average: %17i\n", bel);
}
How would I affect this function so that it would do that? I have an idea, but gotta make sure I get all of the points on this one. Thanks in advance.