After scanning a char (B or C or D or any char) for next iteration you need to escape the next char (probably a newline or any such char which is not needed).
Workaround :- scanf(" %C"); // note the space before %
And also please make sure from next time when you attach a link, check if its your submitted solution link. The link that you attach is of IDE link with no code of yours.
Adding space before % comes under “formatting input string part”, which does nothing but omits newline char (’\n’) or any white space char, and accepts next char. Read more about scanf and format specifiers you will get to know more.