23 lines
234 B
Text
23 lines
234 B
Text
i32 main()
|
|
{
|
|
i32 x = 0;
|
|
i32 i = 0;
|
|
|
|
// Test while loop with break
|
|
while (i < 10) {
|
|
i = i + 1;
|
|
if (i == 5) {
|
|
break;
|
|
}
|
|
x = x + i;
|
|
}
|
|
|
|
// Test goto and label
|
|
if (x == 10) {
|
|
goto skip;
|
|
}
|
|
x = 999;
|
|
|
|
skip:
|
|
return x;
|
|
}
|