title: K&R Exercise 1-14 solution
body: <p>I was working out this exercise and wanted to know if my answer is correct;</p>
  
  <blockquote>
    <p>Write a program to print a histogram of the frequencies of different
    characters in the input.</p>
  </blockquote>
  
  <p>I have seen a couple of other answers online but they differ quite a lot to mine. Also if there are any problems in the format of my code or any improvements to be made. Any suggestions are welcome. I do understad the question requires a histogram but it's quite easy to build one once I have the data required.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(){
  
      int userInput;
      int arrayStuff[92];
      int i, j;
  
      for(i = 0; i &lt; 92; ++i){
          arrayStuff[i] = 0;
      }
  
      while((userInput = getchar()) != '\n'){
          if(userInput &gt;= 30 &amp;&amp; userInput &lt;= 122){
              if(userInput != '\n'){
                  ++arrayStuff[(userInput-30)];
              }
  
              if(userInput == '\n'){
                  break;
              }
          }
      }
  
      printf("Case\t|\tOccurances\n");
  
      for(i = 0; i &lt; 92; ++i){
          printf("%c\t|\t%d\n", (i+30), arrayStuff[i]);
      }
  }
  </code></pre>