Nusrat_Ullah

Lower to Upper and vice versa

Feb 21st, 2021
892
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int i;
  6.     string a,up,lo;
  7.     getline(cin,a);
  8.     for(i=0;a[i];i++){
  9.         if(isupper(a[i])){
  10.             lo.push_back(a[i]+32);
  11.         }
  12.         else{
  13.             up.push_back(a[i]-32);
  14.         }
  15.     }
  16.     cout<<"Upper = "<<up<<endl;
  17.     cout<<"Lower = "<<lo<<endl;
  18.     return 0;
  19. }
  20.  
RAW Paste Data