5% assure discount from here only

Monday, January 24, 2011

(3) How to reverse array elements?

Solution :

my @a = ( 1 ,4,2, 9,10 );
my $length = scalar(@a);
my @b;
for(my $i=0;$i<=$length;$i++){ my $j = $a[$length - $i]; push(@b, $j); } print @b;

No comments:

Post a Comment