Find the error(s) in the following recursive method, and explain how to correct it: static int Sum(int

Question:

Find the error(s) in the following recursive method, and explain how to correct it:

static int Sum(int n)

{

if (n == 0)

{

return 0;

}

else

{

return n + Sum(n);

}

}

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

Step by Step Answer:

Related Book For  book-img-for-question

Visual C# How to Program

ISBN: 978-0134601540

6th edition

Authors: Paul J. Deitel, Harvey Deitel

Question Posted: