ok i dont quite know why i keep getting these error in my program.. here is the program:
#include<stdlib.h>
#include<stdio.h>
#include<math.h>
Void open(void);
int read(float*);
float average(float*);
void write(float*,float);
void close(void);
FILE *fptrin,*fptrout;
main()
{
float number[10],non,ave;
open();
read(number);
non=read(number);
ave=average(number,non);
write(number,ave,non);
close();
return(0);
}
void open(void)
{
fptrin=fopen("avg.dat""r");
if(fptrin==0)
{
printf("\nFile Will Not Open!!!!\n);
exit(0);
}
return;
void close(void)
{
fclose(fptrin);
fclose(fptrout);
return;
}
void write(float *number,float,ave,int non)
{
int i;
for(i=0;i<non;i++)
{
fprintf(fptrout,"%f\n",number[i];
printf("\n%f",number[i]
}
fprintf(fptrout,"%f",ave);
printf("\n%f",ave);
return;
}
int read(float *number)
int i,done;
for(i=0;i<non;i++)
{
done=fscanf(fptrin,"%f",&number[i];
if(done==-1)break;
}
return(i);
float average(float *number,int non)
float sum,avg;
printf(\navg is beint calculated!!!");
sum=0;
for(i=o;i<non;i=i++)
{
sum=sum+number[i];
{
avg=sum/i;
return(avg);
}
}
}