My program reads a list of integers from user input [ keyboard] and calculates some statistics
The user enters 'x' to terminate the input process.
So for example,
Enter integers separated by space ( enter x to quit) : 1 2 3 4 5 x
But now I want to include the inputs to be read from file redirection also. So if the numbers followed by x is in a data file, the program should take it from there if not then prompt the user