CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Switch Fall-Through Without Break

C code walkthrough · Question 22
mediumControl Flow

Code

Read carefully. What does this print?
1#include <stdio.h>
2int main() {
3 int x = 2;
4 switch (x) {
5 case 1: printf("one ");
6 case 2: printf("two ");
7 case 3: printf("three ");
8 case 4: printf("four\n"); break;
9 case 5: printf("five\n");
10 }
11 return 0;
12}

Your answer