The expression in the if statement must use a boolean operator that returns a boolean result. % returns a numeric value.
See the tutorial for a list of operators that return a boolean result: ...
Type: Posts; User: Norm
The expression in the if statement must use a boolean operator that returns a boolean result. % returns a numeric value.
See the tutorial for a list of operators that return a boolean result: ...
Please copy the full text of the error messages and paste it here.
Please edit your post and wrap your code with
<YOUR CODE HERE>
to get highlighting and preserve formatting.
Are you asking how to determine if a number is odd and negative?
A test for even or odd is to compare the results of theNumber % 2 : 1 is odd, 0 is even
A test for negative is if theNumber < 0
That answers the question. Did you have any other questions?
Can you use the System.out.println() method to print it?