Alright, so I have a text file titled 'Input.txt." The text file contains a variable number of lines of information (for the sake of this, lets say 10). I need to read each line from the file into individual lists or arrays.
Once all the numbers have been read in, I need to calculate the average, median, and mode of the numbers contained within each list or array. The averages, medians, and modes need to be printed out with the corresponding line to a text file called "Results.txt."
I'm attempting to use strtok with for loops and while loops. I'm not sure if this is the best way to do it. I've been able to read in all lines and output all lines, but where I'm having difficulty is doing operations on a single line. My code so far is as follows: