You can do this with scanf. Example



double num;
while ((scanf("%lf", &num) == 1))
printf("Got num: %.8f\n", num);