Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   CLICK here<<(imp) (http://www.go4expert.com/forums/click-here-imp-t24301/)

wafa 28Dec2010 23:20

CLICK here<<(imp)
 
this code chang capter letter to small and small to capter
Code:


#include <iostream>
using namespace std;

int main(){
    string line;
  cout<<"Enter your a  text: ";
    if ( getline ( cin, line ) ) {
        for ( string::size_type i = 0; i < line.size(); i++ )
            if (isupper(line[i]))
                line[i]=tolower(line[i]);
            else if (islower(line[i]))
                line[i]=toupper(line[i]);
        cout<< line <<'\n';
    }
 
return 0;
}

BUT HOW I CAN USE FUNCTION IN THIS PROGRAMME_??:undecided


All times are GMT +5.5. The time now is 16:48.