Search:

Type: Posts; User: Norm

Search: Search took 0.15 seconds.

  1. Re: Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    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: ...
  2. Re: Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    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.
  3. Re: Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    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
  4. Re: Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    That answers the question. Did you have any other questions?
  5. Re: Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    Can you use the System.out.println() method to print it?
Results 1 to 5 of 5