switch statement in C++
#include <iostream>
int main() {
int choice;
std::cout << "Enter a number between 1 and 3: ";
std::cin >> choice;
switch (choice) {
case 1:
std::cout << "You entered 1";
break;
case 2:
std::cout << "You entered 2";
break;
case 3:
std::cout << "You entered 3";
break;
default:
std::cout << "Invalid choice";
}
return 0;
}