Advertisement
mhrabbi

Check Whether a Character is an Alphabet or not( Prob 6)

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