Miti059

4.Alphabet,digit,special

Jun 7th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     char ch;
  6.  
  7.  
  8.     printf("Enter any character: ");
  9.     scanf("%c", &ch);
  10.  
  11.  
  12.  
  13.     if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
  14.     {
  15.         printf("%c is alphabet.", ch);
  16.     }
  17.     else if(ch >= '0' && ch <= '9')
  18.     {
  19.         printf("%c is digit.", ch);
  20.     }
  21.     else
  22.     {
  23.         printf("%c is special character.", ch);
  24.     }
  25.  
  26.     return 0;
  27.     }
Add Comment
Please, Sign In to add comment