Heya im having a little trouble getting parts of the project to compile;
fscanf(fi, %f, &Max);
this is continualy displaying the error message
"syntax error before '%' token "
i am compiling on Dev- C
its probably simple but help is much appreciated
thanks
here is the program so far
#include <stdio.h>
int main()
{
float Max, Min, Temp;
int i;
FILE *fi;
FILE *fo;
if ((fi = fopen("indata.txt", "r")) == 0)
{
printf("error opening file! \n");
return 1;
}
fscanf(fi, %f, &Max);
Min = Max;
for (i = 0; i < 8; i ++)
{
fscanf(fi, %f, &Temp);
if (Temp > Max)
{
Max = Temp;
}
if (Temp < Min)
{
Min = Temp;
}
}
fclose(fi);
if ( (fo=fopen("Result.txt", "w")) == NULL )
{
printf("ERROR opening file!\n");
return 1;
}
fprintf(fo,"The minimum value found is %f" , Min);
fprintf(fo,", The maximum = £f" , Max);
fclose(fo);
return 0;
}