RVBTCC/test/loop/nested.c

20 lines
371 B
C
Raw Normal View History

2024-12-24 15:18:03 +00:00
int printf(char* format, ...);
void test() {
int i;
int j;
for (i = 0; i < 5; i++) {
for (j = 0; j < 5; j++) {
if (i >= 2 && j >= 2 && i + j >= 5) {
return; // Exit nested loop via return
}
printf("(%d, %d)%c", i, j, " \n"[j == 4]);
}
}
}
int main() {
test();
printf("\n");
}