Advertisement
Mahfuz100

zahid5

May 17th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1.  
  2. /**
  3.  * C program to check whether a character is alphabet or not
  4.  */
  5.  
  6. #include <stdio.h>
  7.  
  8. int main()
  9. {
  10.     char ch;
  11.  
  12.     /* Input a character from user */
  13.     printf("Enter any character: ");
  14.     scanf("%c", &ch);
  15.  
  16.  
  17.     if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
  18.     {
  19.         printf("\nCharacter is an ALPHABET.\n");
  20.     }
  21.     else
  22.     {
  23.         printf("\nCharacter is NOT ALPHABET.\n");
  24.     }
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement