texuser74 has asked for the wisdom of the Perl Monks concerning the following question:
Output:3, 4, 10, 2 2, 7, 12, 3 0, 3, 4, 5 6, 5, 9, 11
Please help me in completing my code.1: 2: 3, 4 10, 2 2, 7 2, 3 3: 4: 0, 3 4, 5 6, 5 9, 11
Thanks in advance.@matrix = ([3, 4, 10, 2], [2, 7, 12, 3], [0, 3, 4, 5], [6, 5, 9, 11]); for($row = 0; $row < 2; $row++) { for($col = 0; $col < 2; $col++) { print "$matrix[$row][$col] "; } print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: for loop
by psini (Deacon) on Sep 23, 2008 at 10:15 UTC | |
|
Re: for loop
by apl (Monsignor) on Sep 23, 2008 at 09:59 UTC | |
|
Re: for loop
by ikegami (Patriarch) on Sep 23, 2008 at 19:43 UTC | |
|
Re: for loop
by svenXY (Deacon) on Sep 23, 2008 at 10:02 UTC | |
|
Re: for loop
by dwm042 (Priest) on Sep 23, 2008 at 18:36 UTC | |
|
Re: for loop
by indragoby (Initiate) on Sep 29, 2008 at 09:22 UTC |