title: how to draw a rectangle with diagonals and axes of symmetry in c ++ in the console?
body: <p>I would like to draw a rectangle with * in consol. Now I have code which draw circumference of a rectangle and its axes of symmetry, but I don't know how to draw diagonals. Can you help me? This is my code</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  #include &lt;math.h&gt;
  
  
  int main(int argc, char *argv[]) {
  int s,d;
      printf ("the length of the rectangle \n");
      scanf ("%d",&amp;s);
      printf ("width of the rectangle \n ");
      scanf ("%d",&amp;d);
      int l;
      int p;
      int przekatna; 
  
      for (p=1; p&lt;=s; p++)
      {
      printf ("\n");
      for (l=1;l&lt;=d; l++)
      {
  
      if(p==1 || l==1 || l==d || s==p || p==((d+1)/2)  ) printf("*"); else printf(" ");
      if ( l==(d)/2 &amp;&amp; p!=((d+1)/2) &amp;&amp; p!=1 &amp;&amp; p!=s) 
      printf("*"); else printf(""); 
  
  
      }
  }
       return 0;
  }
  </code></pre>
  
  <p>Edit, its good code, its working my teacher explained to me how to make diagonals and that's what it is</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  
  #include &lt;math.h&gt;
  
  int main() {
      int l;
      int p;
      int s;
      int d;
      printf ("the length of the rectangle  \n");
      scanf ("%d",&amp;s);
      printf ("width of the rectangle  \n ");
      scanf ("%d",&amp;d);
  
      for (p=1; p&lt;=s; p++)
      {
      printf ("\n");
      for (l=1;l&lt;=d; l++)
  
      {
  
      if(p==1 || l==1 || l==d || s==p 
      || p==s/2 || l==l/2 ||
       l==p*round(d/s) || l==(s+1-p)*round(d/s) )
  
      printf("*"); else printf(" ");
  
  
      }
    }
        return 0;
      }
  </code></pre>