#include<iostream>
#include<string>
using namespace std;
void main()
{
string s1;
cout<<"\n\n Enter first string: ";
cin>>s1;
// Lowercase to Uppercase
for(unsigned i=0;i<s1.length();i++)
{
if(s1[i]>='a' && s1[i]<='z')
s1[i]-=32;
}
cout<<"\n\n s1: "<<s1<<"\n\n";
// Uppercase to Lowercase
for(unsigned i=0;i<s1.length();i++)
{
if(s1[i]>='A' && s1[i]<='Z')
s1[i]+=32;
}
cout<<"\n\n s1: "<<s1<<"\n\n";
system("pause");
}
Comments
Post a Comment