Switch with break
Post date: Jan 28, 2013 10:20:12 AM
// This program demonstrates the use of a switch statement.
// The program simply tells the user what character they entered.
using namespace std;
cout << "Enter A, B, or C: ";
cin >> choice;
case 'A':cout << "You entered A.\n";
case 'B':cout << "You entered B.\n";
case 'C':cout << "You entered C.\n";
default: cout << "You did not enter A, B, or C!\n";