Convert a character from uppercase to lowercase

Q. Write a C++ program to convert a character from uppercase to lowercase.


Following program is converting a character a from uppercase to lowercase.

using namespace std;
int main()
        char str[20];
        int i;
        cout<<"\n Enter String in Uppercase : ";
        for(i=0; i<=strlen(str); i++)
                if(str[i]>=65 && str[i]<=90)  //65 to 90 is an ASCII values of 'A' to 'Z'
        cout<<"\n Conversion of above String into Lowercase : "<<str;
        return 0;


convert upper to lower