Because after you input the number and press ENTER, the new line stays in the buffer and will be processed by the second scanf
.
In short, you saved new line in the variable c
.
However ,if you use
scanf(" %c",&c);
// ^
the space will consume the new line, which makes c
the value you expected.