What is the output of the following C program?
#include <stdio.h>
int main(void) {
for (int i = 0; i < 4; i++) {
switch (i) {
case 1:
printf("one ");
break;
case 2:
printf("two ");
continue;
default:
printf("%d ", i);
}
printf("| ");
}
printf("\n");
return 0;
}
Inside a switch, break leaves only the switch, so "| " still prints after "one". continue is not used by switch: it goes to the next loop pass, skipping the "| " after "two".