Loops/Break: Difference between revisions
Content added Content deleted
m (Fixed the XBS example) |
(Added solution for Action!) |
||
Line 226: | Line 226: | ||
Resultat = 10 |
Resultat = 10 |
||
</pre> |
</pre> |
||
=={{header|Action!}}== |
|||
<lang Action!>PROC Main() |
|||
BYTE v |
|||
PrintE("Before loop") |
|||
DO |
|||
v=Rand(20) |
|||
PrintBE(v) |
|||
IF v=10 THEN |
|||
EXIT |
|||
FI |
|||
OD |
|||
PrintE("After loop") |
|||
RETURN</lang> |
|||
{{out}} |
|||
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Break.png Screenshot from Atari 8-bit computer] |
|||
<pre> |
|||
Before loop |
|||
2 |
|||
6 |
|||
3 |
|||
4 |
|||
11 |
|||
17 |
|||
5 |
|||
17 |
|||
10 |
|||
After loop |
|||
</pre> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |
||
<lang Ada>with Ada.Text_IO; use Ada.Text_IO; |
<lang Ada>with Ada.Text_IO; use Ada.Text_IO; |