RosettaCodeData/Task/Loop-over-multiple-arrays-s.../00DESCRIPTION

39 lines
1.1 KiB
Plaintext

;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
through the collection in order with some other loop.
For this example, loop over the arrays:
(a,b,c)
(A,B,C)
(1,2,3)
to produce the output:
aA1
bB2
cC3
<br>
If possible, also describe what happens when the arrays are of different lengths.
;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]]
* &nbsp; [[Loops/with multiple ranges]]
* &nbsp; [[Loops/Wrong ranges]]
<br><br>