Well done finding the problem
There is a quicker way to solve it
double average = (double)sum / count;
Check the relative precedences of cast and divide first.
Don't use underscores_ in variable names. Don't include the type in a variable name if at all possible. Search for “Hungarian notation” for more details.
What does line 21 mean? Does it mean your loop is running once too often? I shall introduce you to some nasty‑looking syntax which will probably solve that problem. One pair of () is needed because the precedence of = is very low, and you need to do the assignment before the inequality
test.
If you are using Scanners however, there is a better way still to do that:-
or
If you enter numbers like this:-
1 2 3 69 34586 723 0 -8345 -1 stop
...you will get nine numbers entered and the “stop” will terminate the loop.