Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
421 B
2
Indexable
#include <bits/stdc++.h>
using namespace std;

int main() {
    string s = "aAbBcCdD";
    string s1;
    
    for(int i = 0; i< s.size(); i++){
        if(isupper(s[i])){
            s1.push_back(char(tolower(s[i])));
        }
        else{
            s1.push_back(char(toupper(s[i])));
        }
    }\
    cout<<"Original string was "<<s<<endl<<"NOW is ";
    for(auto x: s1){
        cout<<x;
    }

    return 0;
}