Consider the following code segment.
int k = 0;
while (k < 10)
{
System.out.print((k % 3) + " ");
if ((k % 3) == 0)
k = k + 2;
else
k++;
}
What is printed as a result of executing the code segment?
A) 0 2 1 0 2
B) 0 2 0 2 0 2
C) 0 2 1 0 2 1 0
D) 0 2 0 2 0 2 0
E) 0 1 2 1 2 1 2