What does the following method do? // Parameter b must be positive to prevent infinite recursion static

Question:

What does the following method do?

// Parameter b must be positive to prevent infinite recursion static int Mystery(int a, int b)

{

if (b == 1)

{

return a;

}

else

{

return a + Mystery(a, b - 1);

}

}

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: