You shouldn't loop in this manner:
Using feof() in the way isn't guaranteed to produce the desired results. You should check the return code from getc() against EOF to see if you're at the end of a file. To do this, make use the variable you are assigning the return value to is an int.
Also, better check the return code from fscanf() to ensure it did actually read a float into the output variable.
while ((c = getc(fp)) != EOF)
/* do stuff */
The int i needs initialising before you use it too, it's starting value undefined.