Jump to content

Loops/Nested: Difference between revisions

Added BBC BASIC
m (→‎{{header|REXX}}: added a comment. -- ~~~~)
(Added BBC BASIC)
Line 134:
NEXT col
NEXT row</lang>
 
=={{header|BBC BASIC}}==
{{works with|BBC BASIC for Windows}}
<lang bbcbasic> DIM array(10,10)
FOR row% = 0 TO 10
FOR col% = 0 TO 10
array(row%,col%) = RND(20) + 1
NEXT
NEXT row%
FOR row% = 0 TO 10
FOR col% = 0 TO 10
IF array(row%,col%) = 20 EXIT FOR row%
NEXT
NEXT row%
IF row%<=10 PRINT "Found at row "; row% " column " ; col%</lang>
EXIT FOR can jump out of multiple nested loops by specifying a control variable.
 
=={{header|bc}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.