The first negative value that is entered is not counted either in the sum or the count. It just happens for the negative values and not positive or zero.
Help is appreciated.
you can't process things in both blocks (think about the logic in English). So if the block setting min = integer;
runs then integer won't be considered in any of the following 'else if' blocks.
I haven't tried it, but I suspect that simply changing 'else if' to just 'if' in line 20 will work.
Could you possibly make your indentation consistent (or are you using a mixture of tabs and spaces)?