getchar() reads a character from the standard input, usually the
keyboard. getchar will also 'echo" the typed character to the standard output, usually the user screen.
I couldn't tell exactly how you wanted this program to work but here's an example.
Code:
#include <stdio.h>
int main(void)
{
int char_count = 0;
char next_char = '\0';
printf(" Enter characters but not the # sign <>");
for(;;)
{
next_char = getchar();
switch(next_char)
{
case 'a': case 'b': case 'c':
char_count++;
printf(" a,b,c count = %d\n", char_count);
break;
default: break;
} // end switch(next_char)
if(next_char == '#')
{
puts(" I said not to enter the # sign!");
break;
} // end if(next_char == '#')
} // end for(;;)
} // end int main(void)