18126

Day2(ex8)

Jul 7th, 2021 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.02 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main() {
  6.     char symbol1 = '4', symbol2 = 'a', symbol3 = 'U';
  7.     int ascii1 = symbol1, ascii2 = symbol2, ascii3 = symbol3;
  8.     if((ascii1 >= 65 && ascii1 <= 90) || (ascii1 >= 97 && ascii1 <= 122)) {
  9.         printf("%c is a higher-case/lower-case letter from the alphabet.\n", symbol1);
  10.     } else {
  11.         printf("%c is not a higher-case/lower-case letter from the alphabet.\n", symbol1);
  12.     }
  13.     if((ascii2 >= 65 && ascii2 <= 90) || (ascii2 >= 97 && ascii2 <= 122)) {
  14.         printf("%c is a higher-case/lower-case letter from the alphabet.\n", symbol2);
  15.     } else {
  16.         printf("%c is not a higher-case/lower-case letter from the alphabet.\n", symbol2);
  17.     }
  18.     if((ascii3 >= 65 && ascii3 <= 90) || (ascii3 >= 97 && ascii3 <= 122)) {
  19.         printf("%c is a higher-case/lower-case letter from the alphabet.\n", symbol3);
  20.     } else {
  21.         printf("%c is not a higher-case/lower-case letter from the alphabet.\n", symbol3);
  22.     }
  23.     return 0;
  24. }
  25.  
Add Comment
Please, Sign In to add comment