removed getchar

getchar(); is a C++ function. And you already used scanf(); which does the same.