I'm trying to write a program that reads unspecified number of positive and negative values, counts them and computes the average of the input values, not counting zeros. The program should end with the input 0 and display the average as a floating point number.
What can I use to count the input values?
Example: If I type 1, 2 and 0 the average should be 1.5
Ps: I'm a beginner...
What can I use to count the input values?
Example: If I type 1, 2 and 0 the average should be 1.5
Ps: I'm a beginner...
Comment