Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   Changing Character case (http://www.go4expert.com/forums/changing-character-case-t28245/)

Valiantangel 22Apr2012 07:30

Changing Character case
 
I also came up with the below code still doesnt work

Code:

#include <iostream>
#include <cctype>

using namespace std;

int main()
{
  char s;
  cout<<"Name your favourite soccer team in uppercase\n";
 
  while (cin.get(s));
  {
    if(isupper(s))
      cout<<(char)toupper(s);
    else
      cout<<s;
  }

    return(EXIT_SUCCESS);
}


Valiantangel 23Apr2012 00:45

Re: Changing Character case
 
Can someone help?

shabbir 23Apr2012 08:33

Re: Changing Character case
 
cout<<(char)toupper(s);

This should be tolower and not toupper.


All times are GMT +5.5. The time now is 08:40.