title: how I can I stop the program from reading 'Enter' as an input?
body: <p>Hi everyone I just finished my program which reads any single character and prints the ASCII value of that character however as it loops it starts to keep reading in enter as well as the other character. </p>
  
  <p>My other problem is I want my program to stop when reading '#' and print it as invalid which I can't seem to do The code looks like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main() {
    char input;
    while (input != '#') {
      printf("\nEnter character: \n");
      scanf("%c*c", &amp; input);
      printf("The ASCII value is: %d", (int) input);
      if (input == '#') break;
    }
    printf("\n# is invalid");
    return (0);
  }
  </code></pre>