title: C while loop - code won't work
body: <p>I've been writing a simple program to check if input letter is a vowel, and my code doesn't work.
  The program should take characters as input one by one until % is entered, which will make it exit. It checks if input chars are vowels, and prints the result. Also it reports an error if input is not a letter.
  The problem is, it breaks out of the loop on the second step.
  Thank you for help, in advance.
  PS Sorry, didn't write that there's no error message, it just breaks out of the loop.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  int main(void)
  {
    char processed='q';
    while(processed != '%')
    {
      printf("Enter letter to check if it's a vowel, %% to quit.\n");
      char input = getchar();
      processed = tolower(input);
      printf("%c\n", processed);
      if (processed == '%')
        break;
      if (processed &lt; 'a' || processed &gt; 'z')
      {
        fprintf(stderr, "Input should be a letter\n");
        exit(1);  
      }
      switch(processed)
      {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
        case 'y':
          printf ("Vowel\n");
          break;
        default:
          printf ("Non-vowel\n");
      }
    }
    exit(0);
  }
  </code></pre>