SHARE
TWEET

Switch Q3

DARKADVERSARY Oct 24th, 2019 108 in 315 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.  
  6.     char code_size;
  7.  
  8.     cout << "Enter your shirt size : ";
  9.     cin >> code_size;
  10.  
  11.     switch(code_size){
  12.  
  13.     case 's':
  14.     case 'S':
  15.  
  16.         cout << "Small size\n";
  17.         break;
  18.  
  19.     case 'm':
  20.     case 'M':
  21.  
  22.         cout << "Medium size\n";
  23.         break;
  24.  
  25.     case 'l':
  26.     case 'L':
  27.  
  28.         cout << "Large size\n";
  29.         break;
  30.  
  31.     default :
  32.  
  33.         cout << "Invalid code!\n";
  34.  
  35.     }
  36.  
  37.     cout << "\nHope you identified you size.";
  38.  
  39.     return 0;
  40.  
  41.  
  42.  
  43.  
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top