Limited access

Upgrade to access all content for this subject

Consider the following method.

public static void mystery()
{
    int i = 0, j = 0, k = 0;
    while (i <=10)
    {
        j++;
        if (j == 3)
        {
            j= 0;
            k++;
        }
        System.out.print(k);
        i++;
    }
}

Which of the following is printed when mystery() is called?

A

00111222333

B

00011122233

C

00112233

D

00001111222

E

00112233445

Select an assignment template