Hi, I'm trying to read an unspecified number of integers from the user's input. However I don't know how to make it so that the program will keep on scanning after the first integer. I try to implement a loop but not sure on how to even begin.
For example user's input:
1 5 3 6 10
The program will only read the "1" then stop, how do you make it so that it will read "1" "5" "3" "6" "10"?
here is the code so far:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
int val;
printf("Input Array Specification: ");
scanf("%d",&val);
printf("val is: %d\n",val);
return 0;
}