source:
CIVL/mods/dev.civl.abc/examples/c/jumps.c
| Last change on this file was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 368 bytes | |
| Rev | Line | |
|---|---|---|
| [aad342c] | 1 | int x = 0; |
| 2 | int y = 0; | |
| 3 | ||
| 4 | void main() { | |
| 5 | ||
| 6 | while (x<10) { | |
| 7 | x++; | |
| 8 | while (y<20) { | |
| 9 | if (x+y==1) return; | |
| 10 | y++; | |
| 11 | } | |
| 12 | } | |
| 13 | ||
| 14 | x = 1; | |
| 15 | ||
| 16 | while (x<30) { | |
| 17 | x--; | |
| 18 | if (x==2) break; | |
| 19 | } | |
| 20 | ||
| 21 | x = 2; | |
| 22 | ||
| 23 | while (x<40) { | |
| 24 | x--; | |
| 25 | if (x==3) { | |
| 26 | x = 3; | |
| 27 | continue; | |
| 28 | } | |
| 29 | } | |
| 30 | ||
| 31 | x = 4; | |
| 32 | ||
| 33 | goto exitpoint; | |
| 34 | ||
| 35 | x = 42; | |
| 36 | x = 42*42; | |
| 37 | ||
| 38 | exitpoint: x = 5; | |
| 39 | } |
Note:
See TracBrowser
for help on using the repository browser.
