title: Outputting a Square Shape C++ using '*'
body: <p>Hello I am very new to programming and my assignment is to output shapes. The first is the square:</p>
  
  <pre><code>int main(){
  unsigned size;
  cout &lt;&lt;"Size: ? ";
  cin &gt;&gt;size;
  for ( unsigned r = 0; r &lt; size; r++ ){ // Square
      for ( unsigned c = 0; c &lt; size ; c++ )
          if ( r == c ) 
              cout &lt;&lt;'*';
      cout &lt;&lt;endl;
  }
  cout &lt;&lt;endl;
  }
  </code></pre>
  
  <p>When I input "5" after being prompted. The output results in:
  5</p>
  
  <p>*</p>
  
  <p>*</p>
  
  <p>*</p>
  
  <p>*</p>
  
  <p>*</p>
  
  <p>Can anyone explain what is wrong with my code? I need to have both horizontal and vertical outputs. Thank you</p>