I need to read and print data from a file. I wrote the program like below,
#include #include int main(void) { char item[9
First of all, you're testing fp twice. so printf("Error Reading File\n"); never gets executed.
fp
printf("Error Reading File\n");
Then, the output of fscanf should be equal to 2 since you're reading two values.
fscanf
2