Evitate la fflush.

"In some implementations this causes the input buffer to be cleared, but this is not standard behavior"

Piuttosto usate

codice:
while(getchar()!='\n') {}
o

codice:
while( (c = getchar()) != EOF && c != '\n');
Cioè se gli inserisci le parentesi graffe anche solo vuote poi rimane in attesa
quel ciclo, con il corpo vuoto, consuma i caratteri nel buffer di input (usando getchar) fino a che non incontra il carattere di newline, in modo che i successivi input non vengano saltati a causa del buffer sporco