Advertisement
Mahmud33

alphabet, digit or special character

May 25th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     char chr;
  5.     printf("Enter the character: ");
  6.     scanf("%c", &chr);
  7.  
  8.     if( (chr >= 'a' && chr <= 'z') || (chr >='A' && chr <= 'Z')){
  9.         printf("It's Alphabet");
  10.     }
  11.     else if( chr>= '0' && chr <= '9' ){
  12.         printf("It's Number");
  13.     }
  14.     else {
  15.         printf("Special Character");
  16.     }
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement