Limited access

Upgrade to access all content for this subject

Consider the following recursive method.

 public static int mystery(int x)
 {
     if (x > 2)
        return x;
     else
        return x + mystery(x - 1);
 }

What is returned by the call mystery(5)?

A

5

B

11

C

12

D

14

E

15

Select an assignment template