for scanf and getchar understanding