title: Making a Hash Pyramid
body: <p>Currently doing the CS-50 course and was wondering if anyone could help me with this. I'm supposed to create a program which will ask a user for a height between 1-23 (and continuously prompt the user until a valid answer is given) --- I was able to code that part.</p>
  
  <pre><code>#include &lt;cs50.h&gt;
  #include &lt;stdio.h&gt;
  
  int main(void)
  { 
      int height;
      do
      {
          printf("please give me a height between 1-23: ");
          height = GetInt();
      }    
      while (height &lt; 1 || height &gt; 23);
  }
  </code></pre>
  
  <p>The do while loop seems to do what its intended. Now, the program, given the variable "height" now needs to create a pyramid of that height. The bottom of the pyramid is to be aligned with the bottom left hand of the terminal and its last "row" is to finish with 2 hashes as such:</p>
  
  <p>Sample pyramid of height 4:</p>
  
  <pre><code>    ##
     ###
    ####
   #####
  </code></pre>
  
  <p>But the code needs to be generic for any height of pyramid 1-23.
  This is where I'm having a hard time (in actually making a code to draw this).</p>
  
  <p>Ive noticed that for each row, the number of hashes needed (if we call the top row "row 1" and the subsequent "row 2" and so on... is 
  <strong>row number+1</strong>. As for the amount of spaces that are needed, can be represented by <strong>height-row number</strong>.
  If someone would be able to explain to me how I could write this program using C, it would be much appreciated! :)</p>