1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Help me to continue

Discussion in 'Perl' started by priyasub, May 1, 2009.

  1. priyasub

    priyasub New Member

    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
     
  2. priyasub

    priyasub New Member

    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
     
  3. pradeep

    pradeep Team Leader

    Code:
    #/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?
     

Share This Page