Limited access

Upgrade to access all content for this subject

Consider the following method.

    //Precondition: x >= 0
    public static int mystery(int x)
    {
        int z = 1;
        for (int i = 1; i <=x; i++)
            z*=i;
        return z;
   }

Which of the following is returned by the call mystery(5) ?

A

1

B

24

C

60

D

120

E

720

Select an assignment template