title: How to print star pattern using only 2 for loops
body: <p>I want to print this pattern [half diamond shape]</p>
  
  <pre><code>  *
   * *
  * * *
  </code></pre>
  
  <p>by using 2 for loops
  its really easy to print this pattern by using 3 for loops</p>
  
  <pre><code>#include&lt;conio.h&gt;
  #include&lt;stdio.h&gt;
  
  void main()
  {
    clrscr();
    int i,j,k;
    for(i=0;i&lt;3;i++) //loop for number of lines
    {
        for(j=3;j&gt;i;j--) // loop for printing _ 
        {
          printf(" ");
        }
        for(k=0;k&lt;=i;k++) // loop for printing *_
        {
          printf("* ");
        }
        printf("\n");
    }
    getch();
  }
  </code></pre>
  
  <p>So plz help me......</p>