Dopo la scanf

while(getc(stdin)!='\n');