2015-02-20 00:35:01 -05:00
|
|
|
{{omit from|GUISS}}
|
|
|
|
|
{{omit from|M4}}
|
2016-12-05 22:15:40 +01:00
|
|
|
|
|
|
|
|
;Task:
|
2013-04-10 21:29:02 -07:00
|
|
|
Show the following output using one loop.
|
|
|
|
|
1, 2, 3, 4, 5
|
|
|
|
|
6, 7, 8, 9, 10
|
|
|
|
|
|
2016-12-05 22:15:40 +01:00
|
|
|
|
2015-02-20 00:35:01 -05:00
|
|
|
Try to achieve the result by forcing the next iteration within the loop
|
|
|
|
|
upon a specific condition, if your language allows it.
|
2018-06-22 20:57:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
;Related tasks:
|
|
|
|
|
* [[Loop over multiple arrays simultaneously]]
|
|
|
|
|
* [[Loops/Break]]
|
|
|
|
|
* [[Loops/Continue]]
|
|
|
|
|
* [[Loops/Do-while]]
|
|
|
|
|
* [[Loops/Downward for]]
|
|
|
|
|
* [[Loops/For]]
|
|
|
|
|
* [[Loops/For with a specified step]]
|
|
|
|
|
* [[Loops/Foreach]]
|
|
|
|
|
* [[Loops/Increment loop index within loop body]]
|
|
|
|
|
* [[Loops/Infinite]]
|
|
|
|
|
* [[Loops/N plus one half]]
|
|
|
|
|
* [[Loops/Nested]]
|
|
|
|
|
* [[Loops/While]]
|
2019-09-12 10:33:56 -07:00
|
|
|
* [[Loops/with multiple ranges]]
|
|
|
|
|
* [[Loops/Wrong ranges]]
|
2016-12-05 22:15:40 +01:00
|
|
|
<br><br>
|