I\'m trying to read a character from the console (inside a while loop). But it reads more than once.
Input:
a
Output:
To read just one char, use getchar instead:
int c = getchar(); if (c != EOF) printf("%c\n", c);