Hello.

I am working on a program that will compute arithmetic mean of certain number of real numbers (in C double) without knowing the number of items.

I can think of two solutions.

1) I can declare an array of doubles of huge length and then ask user to start entering its values. After writing the first and every next term then before continuing I can ask the user whether they want to continue adding new values, or it is the end already. That would work.

2) Is there a way how to enter all values at the same time separated by space? Let's say that the user input could be:

orCode:2 5 8 10

orCode:10 15 20.4 80 100

Maybe in the 2) solution I can consider the user's input as a string and work out from that the numbers to compute their mean.Code:1 2 3

Is there a better way how to code the 2nd solution?