SHARE
TWEET

Problem - 4 : alphabet, digit or special character

a guest May 24th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.  
  6.     char ch;
  7.  
  8.     printf("Enter anything : ");
  9.     scanf("%c",&ch);
  10.  
  11.     if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')){
  12.  
  13.         printf("%c is a Alphabet\n",ch);
  14.  
  15.     }
  16.  
  17.     else if(ch >= '0' && ch <= '9'){
  18.  
  19.         printf("%c is  a Digit\n",ch);
  20.  
  21.     }
  22.  
  23.     else {
  24.  
  25.         printf("%c is a Special Character\n",ch);
  26.  
  27.     }
  28.  
  29.     return 0;
  30.  
  31. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top