Hey...
I've written a program that changes a single character from uppercase to lowercase and viceversa but I want to change a whole word from uppercase to lowercase and viceversa
how do I do that?
#include <cctype>
#include <iostream>
using namespace std;
int main()
{
for (int i=1;i<=10;i++){
char ch;
cout<<"Enter a character: ";
cin>> ch;
if ( isalpha ( ch ) ) {
if ( isupper ( ch ) )
cout<<"The lower case equivalent is "<< static_cast<char> ( tolower ( ch ) ) <<endl;
else
cout<<"The upper case equivalent is "<< static_cast<char> ( toupper ( ch ) )<<endl;
}
else
cout<<"The character is not a letter"<<endl;
while ( cin.get ( ch ) && ch != '\n' )
;
}
system("pause");
return 0;
}