Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Perl (http://www.go4expert.com/forums/perl/)
-   -   Help me to continue (http://www.go4expert.com/forums/help-continue-t17256/)

priyasub 1May2009 13:52

Help me to continue
 
i need a help in executing a for loop... the output should be in the form as below
1
12
123
1234
how to do it..
im new to learn PERL Language..
help me

priyasub 1May2009 13:52

Re: Help me to continue
 
i need a help in executing a for loop... the output should be in the form as below

1234
123
12
1


how to do it..
im new to learn PERL language

pradeep 12May2009 17:48

Re: Help me to continue
 
Code: Perl

#/usr/bin/perl

for my $a (1..9)
{
  print $_ for(1..$a);
  print "\n";
}

for(my $i=9;$i>0;$i--)
{
  for(my $j=1;$j<$i;$j++)
  {
    print $j;
  }
  print "\n";
}


Btw, which programming language do you know?


All times are GMT +5.5. The time now is 13:04.