title: Drawing multiple rectangles using for loops in C
body: <p>I wrote a program in C which gets height and width or rectangle, and prints it like this:
  The first border contains the letter a, the second border the letter b, the third border the letter c and so on.</p>
  
  <p>It should look something like this: <br></p>
  
  <pre><code>aaaaaa 
  abbbba 
  abccba 
  abccba
  abbbba 
  aaaaaa 
  </code></pre>
  
  <p>code: </p>
  
  <pre><code>int height, width, letter=97, counter; //ascii value for a
  int i, j;
  
  scanf("%d%d", &amp;height, &amp;width);
  
  for (i=1 ; i &lt;= height ; i++)
  {
      for (j=1 ; j &lt;= width ; j++)
      {
              if (i == 1 || i == height || j == 1 || j == width)
                  printf("%c", letter);
              else
              {
                  if (i == 1+1 || i == height-1 || j == 1+1 || j == width-1)  
                      printf("%c", letter+1);                                 
                  else
                      printf("%c", letter+1+1);
              }
      }
      printf("\n");
  }
  
  system("pause");
  </code></pre>
  
  <p>Sadly, I can't manage to find a way how to make the if loop work multiple times. I can only type it the amount of times I want.
  how can I make a "counter" variable which runs the else of the if multiple times, so I can make more letters?</p>
  
  <p>I try to make a counter variable that will work on the if statement instead of putting <code>i == 1+1</code> it will be <code>i == 1+counter</code></p>