?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

Tracing Recursion

APCSA-B6YIML

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