i am trying to read a text file like this and store each number as an integer (without the decimals) and print them
#include <stdio.h>
#include <conio.h>
void main()
{
int i, n=1;
int n1=0,n2=0,n3=0,n4=0,n5=0,n6=0,n7=0,n8=0,n9=0,n10=0;
char c[10];
FILE *f1;
f1=fopen("textfile.txt","r");
while(fgets(c,10,f1)!=NULL)
{
sscanf(c,"%d %d %d %d %d %d %d %d %d %d", &n1, &n2, &n3, &n4, &n5, &n6, &n7, &n8, &n9, &n10);
printf("%d %d %d %d %d %d %d %d %d %d\n",n1,n2,n3,n4,n5,n6,n7,n8,n9,n10);
getch();
}