I created a file with content: '12 7 -14 3 -8 10'
I want to output all numbers of type integer. But after compiling and running the program, I get only the first number '12'
Here's my code:
#include <stdio.h>
main(){
FILE *f;
int x;
f=fopen("C:\\Users\\emachines\\Desktop\\ind\\in.txt", "r");
fscanf(f, "%d", &x);
printf("Numbers: %d", x);
fclose(f);
}
What am I doing wrong?