I'm learning C++ and experimenting with switches.
For some reason my expression looks like it is being matched with cases it does not actually match.
For example see the snippet below. Here, if the user provides input [A], it still triggers the cases that should match input [B] and [C].
#include <iostream>
int main() {
char choice;
while (choice != 'A' && choice != 'B' && choice != 'C') {
std::cout << "\nInput either A, B, or C\n";
std::cin >> choice;
}
switch (choice) {
case 'A':
std::cout << "\nCase A\n";
case 'B':
std::cout << "\nCase B\n";
case 'C':
std::cout << "\nCase C\n";
}
}
How have I done this? What do I not understand?