Search:

Type: Posts; User: dicdic

Search: Search took 0.08 seconds.

  1. Re: Another recursive method! pretty stuck on this one.

    because at line 8, your parameter number is equal to 3 and the program calls again the method sum, so it would be 3 + sum(3 - 1) right?
    then that where the line 9 appears, at line 9, your parameter...
  2. Re: Another recursive method! pretty stuck on this one.

    the sum is: 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 so it is 55.
    how?
    first you are going to call that method somewhere in your code.
    let say sum(10);.
    are you familiar with stack in programming?...
Results 1 to 2 of 2