Skip to content

Commit f390cae

Browse files
committed
test
1 parent 78d2531 commit f390cae

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/nested_switch.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
void print_int(int x);
2+
int scan_int();
3+
void print_string(char*);
4+
char scan_char();
5+
6+
int main(){
7+
int a;
8+
char b;
9+
a=scan_int();
10+
b=scan_char();
11+
12+
switch(a) {
13+
case 1:
14+
print_string("This is part of outer switch" );
15+
16+
switch(b) {
17+
case 'a':
18+
print_string("This A is part of Inner switch" );
19+
break;
20+
case 'b':
21+
default : print_string("End of Inner switch");
22+
}
23+
case 2:
24+
default: print_string("End of Nested Switch");
25+
}
26+
return 0;
27+
}

0 commit comments

Comments
 (0)