title: How to make hollow box using two for loops
body: <p>Use nested for loops statements to draw hallow boxes of "*"s. The boxes have the same number of rows and columns and this number should be input from the user (valid range: 5 to 21). I'm having trouble coming up with a way to make the box hollow. this is what i have for the code and it comes as a complete square, but i need it to be hollow or just the border.</p>
  
  <pre><code>System.out.println("How many rows/columns(5-21)?");
      rows=input.nextInt();
      while(rows&lt;5||rows&gt;21){
        System.out.println("Out of range. Reenter: ");
        rows=input.nextInt();
      }
      for(m=1;m&lt;=rows;m++){
        for(c=1;c&lt;=rows;c++){
          System.out.print("*");
        }
        System.out.println();
      }
  </code></pre>
  
  <p>the output should look like this:
  How many rows/columns (5-21)? 25 
  Out of range. Reenter: 7</p>
  
  <pre><code>******* 
  *     * 
  *     * 
  *     * 
  *     * 
  *     *  
  *******
  </code></pre>