ShadmanTaqi

Switch Case Range

Mar 8th, 2021
593
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     char  alpha;
  6.  
  7.     printf("Enter the char: ");
  8.     scanf("%c", &alpha);
  9.  
  10.     switch(alpha)
  11.     {
  12.  
  13.     case 'A' ... 'Z':
  14.         printf("Capital Letter");
  15.         break;
  16.  
  17.     case 'a' ... 'z':
  18.         printf("Small Letter");
  19.         break;
  20.  
  21.     case '0' ... '9':
  22.         printf("Digits");
  23.         break;
  24.  
  25.     default:
  26.         printf("Wrong Input");
  27.     }
  28.  
  29.     return 0;
  30. }
  31.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×