1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

To print Pattern?

Discussion in 'C#' started by Vivianflo, Apr 20, 2012.

  1. #1
    I have to print this below pattern in C#

    /*
    1
    111
    1111
    11111
    */
    SEMrush
    How can i get this output?
     
    Vivianflo, Apr 20, 2012 IP
    SEMrush
  2. sarahk

    sarahk iTamer Staff

    Messages:
    26,373
    Likes Received:
    3,929
    Best Answers:
    111
    Trophy Points:
    665
    #2
    I would have thought that would be pretty straightforward in any programming language.

    What business problem are you trying to solve or is this schoolwork?
     
    sarahk, Apr 21, 2012 IP
  3. amkeabhi123

    amkeabhi123 Member

    Messages:
    219
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #3
    for (int i = 1; i < 5; i++)
    {
    for (int j = 1; j <= i; j++)
    {
    Response.Write("1");


    }
    Response.Write("<div style='clear:both;'></div>");
    }
     
    amkeabhi123, Jun 20, 2012 IP