I\'m trying to read a character from the console (inside a while loop). But it reads more than once.
Input:
a
Output:
you could always use char a = fgetc (stdin);. Unconventional, but works just like getchar().
char a = fgetc (stdin);
getchar()