What is the output of the following code snippet?
for (int m = 0; m < 5; m++) {
if (m == 2) {
continue;
}
System.out.print(m + " ");
}
if (m == 2) {
continue;
}
System.out.print(m + " ");
}
A. 0 2 4
B. 2 4
C. 0 1 3 4
D. 0 1 2 3 4
Answer: Option C
Related Questions on Flow Control
What is the purpose of the "if" statement in Java?
A. To execute a block of code conditionally
B. To create loops
C. To declare variables
D. To define methods
A. No output
B. Error
C. Hello
D. 5
Join The Discussion