Advertisement
apl-mhd

Lowercasetouppercase

Aug 27th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.68 KB | None | 0 0
  1. #include<cstdio>
  2. #include<string.h>
  3. #include<ctype.h>
  4.  
  5. void loWerToUpperViceVersa(char name[]){
  6.  
  7.         int i = 0;
  8.  
  9.         while(name[i]){
  10.  
  11.           if(name[i]  >=65 && name[i] <=90 ){
  12.  
  13.               name[i] = name[i] + 32;
  14.  
  15.           }
  16.  
  17.           else  if(name[i]  >=97 && name[i] <=122 ){
  18.  
  19.               name[i] = name[i] - 32;
  20.  
  21.           }
  22.  
  23.           printf("%c", name[i]);
  24.  
  25.           i++;
  26.  
  27.         }
  28.  
  29.         printf("\n");
  30.  
  31.  
  32.  
  33.  
  34.  return void();
  35. }
  36.  
  37.  
  38. int main(){
  39.  
  40.  
  41.  
  42.     char name[100] = "Amar SOnArBangLa Amit";
  43.     char name2[100] = "tui muri kha";
  44.  
  45.     loWerToUpperViceVersa(name);
  46.     loWerToUpperViceVersa(name2);
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.     return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement