Search:

Type: Posts; User: IneedHelpwithJava

Search: Search took 0.08 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.

    Sure! Hold on...


    package variables;
    public class SimpleCalc {
    public static void main(String[] args){
    int n=11;
    if (n<0){
    if (n%2); ...
  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.

    Thank you I will try this and come back

    --- Update ---

    That was helpful (i now understand the modulus operator) but I am getting problems in my code where it is not converting to boolean. See...
  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.

    I was wondering how I could go about printing a number both negative and odd using "if" statements and (I'm assuming but not entirely sure) boolean?
  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.

    Yes I can use println
  5. Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    I am really new to java and wanted to know how I can print an int which is both negative and odd and if so, needs to be put into the formula (n^2+1) . I am not looking particularly for answers...
Results 1 to 5 of 5