Search:

Type: Posts; User: mattig89ch

Search: Search took 0.06 seconds.

  1. Replies
    14
    Views
    1,463

    Re: Finding the Greatest Common Denomenator

    oooooohhhhhhh, thats where the problem is then. I thought that || meant and. um....what does it mean?

    Edit: just updated the code, 25 and 30 now produce a result of 5! Woo! Thanks for your...
  2. Replies
    14
    Views
    1,463

    Re: Finding the Greatest Common Denomenator

    At this point, I'm getting decimals in my returns. no idea why. For example, if you divide 25 by 10 the result is 2.5. But when its saying that 25 % 10 = 0, so its storing 10 in GCD.



    At the...
  3. Replies
    14
    Views
    1,463

    Re: Finding the Greatest Common Denomenator

    ok, I'm with you so far. I think.

    its supposed to stop when the counter reaches the smallest number. And only assign anything to the GDC variable if the firstResult and secResult are both 0.
    ...
  4. Replies
    14
    Views
    1,463

    Re: Finding the Greatest Common Denomenator

    I did acutally, but I'll post it again.



    int firstInput = Integer.parseInt(JOptionPane.showInputDialog("Enter First number"));
    int secInput =...
  5. Replies
    14
    Views
    1,463

    Re: Finding the Greatest Common Denomenator

    Ok, I still haven't been able to find where my problem is. Does anyone know where my logic is going bad?
  6. Replies
    14
    Views
    1,463

    Re: Finding the Greatest Common Denomenator

    Right-o. I'm running the math through a do-while loop that terminates when the counter reaches the size of the smallest variable.

    The counter both controls the loop and provides something to get...
  7. Replies
    14
    Views
    1,463

    Re: Finding the Greatest Common Denomenator

    Thanks for that link. I think I may have a way to do it w/out using arrays. Would someone mind checking my logic to see how right or wrong I am?

    First the user inputs 2 numbers.

    Next I check...
  8. Replies
    14
    Views
    1,463

    Finding the Greatest Common Denomenator

    Hidy ho all,

    I just got an assignment where I have to find the Greatest Common denominator of 2 numbers that a user inputs.

    My first idea on how to do this is to loop through both numbers to...
Results 1 to 8 of 8