If you want to read data from a file using the FILE set of functions, then you need to open the file for reading.


fp = fopen("d.dat", "r");

Then assuming the file contains numbers in the...