At line 12, your code reads a single value. If you want to read three values from the file, change the fscanf to read three values into three variables. Also, number is of type int, it won't do very well at reading a floating-point value such as 1.3.