title: How to display a simple hollow asterisk rectangle in console?
body: <p>Could someone advise me on a simple way to implement hollow rectangles in C#?</p>
  
  <p>I have been able to make a simple rectangle, but hollow rectangle programs I've looked at either contained or arrays or were pretty convoluted. For instance, the solution on <a href="http://cboard.cprogramming.com/csharp-programming/117379-hollow-square.html" rel="nofollow noreferrer">another forum</a> that seems too challenging, and <a href="https://codereview.stackexchange.com/a/23299/11074">this answer on CodeReview.SE</a> is too difficult to understand.</p>
  
  <p>This is what I've done, which displays a simple (filled) rectangle. How to output a hollow rectangle using <code>if</code> logic if possible?</p>
  
  <pre><code>class Nested_Loops_Hollow_Rectangles
  {
      public void RunExercise()
      {
          // how are now supposed to make this hollow?
          // columns are side by side, rows is number of top to bottom
          // see tut
          Console.WriteLine("Welcome to the HollowRectanglePrinter Program.");
          Console.WriteLine("How many columns wide should the rectangle be?"); //i.e. 4
          int iColMax, iRowMax;
          string userChoiceC = Console.ReadLine();
          Int32.TryParse(userChoiceC, out iColMax);
          Console.WriteLine("How many rows tall should the rectangle be?  "); //i.e. 4
          string userChoiceR = Console.ReadLine();
          Int32.TryParse(userChoiceR, out iRowMax);
          Console.WriteLine("Here you go:");
  
          if (iRowMax &gt; 0 || iColMax &gt; 0) 
          {
              for (int iRow = 0; iRow &lt; iRowMax; iRow++) 
              {
                  for (int iCol = 0; iCol &lt; iColMax; iCol++) 
                  {
                      Console.Write("*");
                  }
  
                  Console.WriteLine();
              }
          }
      }
  }
  </code></pre>