do {
input = scan.nextInt();
//calculates minimum
if (input < min) {
min = input;
}
//calculates sum of even integers
else if (input % 2 != 1) {
sumeven = sumeven+1;
}
//calculates sum of negative integers
if (input < 0) {
sumnegative += input;
}
} while (input != 0);
So the program lets the user enter a series of inputs. The problem that I'm having, is when I type a number that's less than 0. The program is supposed to tell me how many even integers there are. So the issue is when the user types a sequence that's like:
-1 -2 -45 -90 1 23 678 90 0.
The program will tell me that there's 3 even numbers. It doesn't count the negative numbers as even numbers for some reason?