Advertisement
mabwehz

checkIfAlphabet

May 17th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     char input;
  6.  
  7.     printf("==CHECK IF INPUT IS AN ALPHABET==\nEnter a character: ");
  8.     scanf("%c", &input);
  9.  
  10.     if (input >= 65 && input <= 90) {
  11.       printf("The character you entered is an uppercase alphabet\n");
  12.     } else if (input >= 97 && input <= 122) {
  13.       printf("The character you entered is a lowercase alphabet\n");
  14.     } else {
  15.       printf("The character you entered is not an alphabet\n");
  16.     }
  17.    
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement