title: C Program that counts Words and Lines in Standard input
body: <p>I am new to C programming and I am currently trying to teach myself how to create a C program that can count words and lines in the input stream and print the two totals to the standard output.</p>
  
  <p>What I am actually trying to do is to have the program count the number of lines and count the number of words depending on the definition of a word in which I feel that I am off. </p>
  
  <p>I want the words to exclude blanks, tabs, newlines, hyphens, or colons. While having the program output the results (words and lines) as decimals.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  {
      int iochar;
      int words;
      int lines;
  
      printf("Enter something here:\n\n");
  
      while ((iochar = getchar ()) !=EOF)
      {
          if((iochar == ' ') || (iochar == '\t') || (iochar == '\n'))
  
          putchar(iochar);
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Am I totally off on this program?</p>