RosettaCodeData/Task/Loop-over-multiple-arrays-simultaneously/00DESCRIPTION

39 lines
1.1 KiB
Text
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
;Task:
Loop over multiple arrays   (or lists or tuples or whatever they're called in
your language) &nbsp; and display the &nbsp; <big><big> ''i'' <sup>th</sup> </big></big> &nbsp; element of each.
Use your language's &nbsp; "for each" &nbsp; loop if it has one, otherwise iterate
2015-11-18 06:14:39 +00:00
through the collection in order with some other loop.
2013-04-10 21:29:02 -07:00
2016-12-05 22:15:40 +01:00
For this example, loop over the arrays:
(a,b,c)
(A,B,C)
(1,2,3)
to produce the output:
aA1
bB2
cC3
<br>
2013-04-10 21:29:02 -07:00
If possible, also describe what happens when the arrays are of different lengths.
2018-06-22 20:57:24 +00:00
;Related tasks:
* &nbsp; [[Loop over multiple arrays simultaneously]]
* &nbsp; [[Loops/Break]]
* &nbsp; [[Loops/Continue]]
* &nbsp; [[Loops/Do-while]]
* &nbsp; [[Loops/Downward for]]
* &nbsp; [[Loops/For]]
* &nbsp; [[Loops/For with a specified step]]
* &nbsp; [[Loops/Foreach]]
* &nbsp; [[Loops/Increment loop index within loop body]]
* &nbsp; [[Loops/Infinite]]
* &nbsp; [[Loops/N plus one half]]
* &nbsp; [[Loops/Nested]]
* &nbsp; [[Loops/While]]
2019-09-12 10:33:56 -07:00
* &nbsp; [[Loops/with multiple ranges]]
* &nbsp; [[Loops/Wrong ranges]]
2016-12-05 22:15:40 +01:00
<br><br>