title: Printing out patterns with asterisks
body: <p>So this teacher assigned us to write 2 code that one of them prints out a triangle-like pattern, with character '*'!And he told us to do so, using the loop for.I managed to do it with the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  
  int main()
  {
  int i,j;
  for(i=1;i&lt;11;i++)
  {
      cout&lt;&lt;endl;
      for(j=1;i&gt;j;j++)
      {
          cout&lt;&lt;'*';
      }
  }
  for(i=10;i&gt;0;i--)
  {
      cout&lt;&lt;endl;
      for(j=1;i&gt;j;j++)
      {
          cout&lt;&lt;'*';
      }
  }
  cin.get();
  return 0;   
  }
  </code></pre>
  
  <p>And it ran flawless. But my mind got frozen when I saw the second one! He's said to write a code that prints out a pattern like this:</p>
  
  <pre><code>   *
    ***
   *****
  *******
   *****
    ***
     *
  </code></pre>
  
  <p>I have no idea how to even start writing it! Can someone help?</p>