And you totally ignored the link above detailing why

fflush(stdin);

is wrong.