1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help me to continue

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

  1. priyasub

    priyasub New Member

    Joined:
    May 1, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    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

    Joined:
    May 1, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    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

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    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