split tests
This commit is contained in:
parent
2b9ed2e2a4
commit
d0f8b3e0ad
12 changed files with 137 additions and 121 deletions
41
test/loop/continue.c
Normal file
41
test/loop/continue.c
Normal file
|
@ -0,0 +1,41 @@
|
|||
int printf(char* format, ...);
|
||||
|
||||
int main() {
|
||||
int i;
|
||||
|
||||
// For loop
|
||||
printf("For loop:\n");
|
||||
for (i = 0; i < 5; i++) {
|
||||
if (i == 3) {
|
||||
continue; // Skip the rest of the loop when i is 3
|
||||
}
|
||||
printf("%d ", i);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
// While loop
|
||||
printf("While loop:\n");
|
||||
i = 0;
|
||||
while (i < 5) {
|
||||
if (i == 3) {
|
||||
i++;
|
||||
continue; // Skip the rest of the loop when i is 3
|
||||
}
|
||||
printf("%d ", i);
|
||||
i++;
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
// Do-while loop
|
||||
printf("Do-while loop:\n");
|
||||
i = 0;
|
||||
do {
|
||||
if (i == 3) {
|
||||
i++;
|
||||
continue; // Skip the rest of the loop when i is 3
|
||||
}
|
||||
printf("%d ", i);
|
||||
i++;
|
||||
} while (i < 5);
|
||||
printf("\n");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue