Code:
fflush(stdin);
Don't do this -- see the FAQ.