I need to read and print data from a file. I wrote the program like below,
#include #include int main(void) { char item[9
fscanf will treat 2 arguments, and thus return 2. Your while statement will be false, hence never displaying what has been read, plus as it has read only 1 line, if is not at EOF, resulting in what you see.
fscanf