My code:
int numLines;
char data[200] = {};
char *Data = data;
printf("Enter the number of lines: ");
scanf("%d", &numLines);
printf("Enter the integers:\n");
getchar();
for (int i = 0; i < numLines; i++) {
fgets(data, 20, stdin);
int numbers = strtol(Data, &Data, 10);
printf("Line %d: has values of: %d ", i + 1, numbers);
}
return 0;
}
what i want: if I input 4 lines and then when it says enter the integers I want to copy and paste something like this (4 lines of random numbers)
1 2 3 4
25346436 346433 6346436
4363433 346 346 346 ```
I want it to print: Line1 contains values of: 1 2 3 4, line 2 contains values of 1 2 3 4 etc etc
please let me know I am new trying to learn