by looking at your code i have modified some in u'r code
Code:
fprintf(infile,"Average Gain/Loss: $ %f\n",(total/soldcnt));
for(i=0;i<20;i++) /*line40*/
{(if gainary[i]!=0)
std=(gainary[i]-(total/soldcnt))sqr/(i-1);
}
with the second code
Code:
void inputfn(int idary[], int soldary[], float paidary[], float
recievedary[],float gainary[], int *soldcnt, int *unsoldcnt){
float paid, recieved, gain;
int id, sold, flag, i;
*soldcnt=0; /*line 60*/
*unsoldcnt=0;
thats the only this i can find in your second code which u have posted. and i think rest are all fine
s.s.harish