Write a recursive method that is equivalent to the following iterative method: 1 2 3 4 5

Question:

Write a recursive method that is equivalent to the following iterative method:

1 2 3 4 5 6 int mystery (int x) { int sum = 0; for(int i = x; i > 0; i--) sum = sum + 1; return sum }

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Java How To Program Late Objects Version

ISBN: 9780136123712

8th Edition

Authors: Paul Deitel, Deitel & Associates

Question Posted: