// Illustrates the use of a switch statement. An equivalent program is // ifelse.cpp, which uses a chain of if else if. #include void main() { char p; cout << "Input Y for yes, or N for no: "; cin >> p; switch (p) { case 'y': case 'Y': cout << "YES\n"; break; case 'n': case 'N': cout << "NO\n"; break; default: cout << "Not a valid reply.\n"; } }