Search:

Type: Posts; User: ManInTheMiddle

Search: Search took 0.14 seconds.

  1. Re: Quick Recursion question involving sum

    Cheers man. I'll give it a shot.

    Much appreciated.
  2. Re: Quick Recursion question involving sum

    No, when I run this code I get 13. The code is right I'm just finding it hard to understand the logic behind it.
    I understand how it works (kind of) just what happens when it gets passed through...
  3. Re: Quick Recursion question involving sum

    I understand how the div and mod works. What I'm having trouble with is when it comes in for the first time.

    256 / 10 = 25
    256 % 10 = 6

    which is 31.
  4. Quick Recursion question involving sum

    Hi,

    I have a recursive method to find the sum of a given number that's greater than 10 respectively.




    static int sum(int n) {
    if(n < 10) {
    return n;
Results 1 to 4 of 4