File name as command line argument

The following example program takes the name of the input file as a command line argument.

Input file should contain integers, separated by either a space or a newline. Reading of the input file is halted if a non-numeric value is found or the end of the file is reached.