the scanf you are using to input the decimal breaks when the enter key is hit however the enter key is left in the input buffer so the getchar() takes it out of the buffer, try adding the following...