title: Printing * pattern in C++
body: <p>I am trying to print a pattern like this</p>
  
  <pre><code>*******
  *     *
  *     *
  *     *
  *     *
  *     *
  *******
  </code></pre>
  
  <p>In this it should look like an empty box.
  but somehow I am not getting even closer </p>
  
  <p>I coded this so far</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main( int argc, char ** argv ) {
  for(int i=1;i&lt;=7;i++)
  {
      for(int j=1;j&lt;=7;j++)
      {
          if(j==1||j==7)
          printf("*");
          else printf(" ");
      }
  
      printf("\n");
  }
  return 0;
  }
  </code></pre>
  
  <p>and my output is</p>
  
  <pre><code>*     *
  *     *
  *     *
  *     *
  *     *
  *     *
  *     *
  </code></pre>
  
  <p>it will be good to have for loop only</p>