Abdullah_A_lAsif_001

check the char

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