I have to use the while loop to accomplish the following "Using a while loop - ask the user for integers; when user enters zero (0) stop . For each non-zero number, count how many even, odd, positive, and negative values are entered."
Personally, I would initialize all of your variables to zero, since initializing them to one assumes that one of each conditions were true, which may be a disadvantage in the long run.
Your if statements aren't quite right. The num= part of each statement is assignment, not an equality comparison. Equality comparison takes the form of ==. Even better, the assignment can be omitted all together. For example:
if( ( num % 2 ) == 0 )
Note that using parentheses within an expression overloads the precedence of the operators used in an expression. In the expression in my if statement, the compiler is forced to compute the expression ( num % 2 ) before testing for equality. The result of an expression is dependent on how the expression is structured.
I'd recommend revising each of your if/else if statements and take what I just said into consideration.
To add to what Framework already said, in your if/else if block of statements, your posTotal and negTotal will never be increased, because every number is going to be either even or odd. Once either of those is true, the program will skip the rest of the else if statements.
You can fix this by removing the "else" from your second else if statement. Then you'll have two seperate blocks of if/else if statements, and it will work the way you're intending.