upper case to lower case and lower case to upper case vice versa using bit manipulation
#include<bits/stdc++.h>
using namespace std;
int main()
{
char chu,chl,up,lo;
cin>>chu;
cin>>chl;
lo=chu&('_');// uppercase to lower case
up=chl|' '; // lowercase to upper case
cout<<up<<" "<<lo<<endl;
return 0;
}
0 Comments