Advertisement
ismail5g

Bitwise

Feb 24th, 2018
81
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. char to_upper(char ch)
  3. {
  4.     return ch & 95;
  5. }
  6. char to_lower(char ch)
  7. {
  8.     return ch | 32;
  9. }
  10.  
  11. int main()
  12. {
  13.     char *str="AbCdEfGhIjKlMnOpQrStUvWxYz";
  14.     int i;
  15.     for(i=0; i<26; i++){
  16.         printf("Uppercase: %c, ", to_upper(str[i]));
  17.         printf("lowercase: %c\n", to_lower(str[i]));
  18.     }
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement