The OP never said it wasn't homework.

You didn't change the getchar() at the end nor any scanf() calls like I suggested.