Originally Posted by
whiteflags
Whether my customer input was going to be correct or not is irrelevant since -- as I keep having to point out -- getchar leaves a \n in the stream, and I do not have an opportunity to enter customer data at all.
Let's review what happens when fgets encounters \n:
If you run my program, you will see what happens when \n is the first thing fgets sees.
Now, for the final time, fgets + sscanf will work fine: just use fgets for all your input or consume the newline getchar will leave behind.