Skip to main content

How to take input in lowercase or convert input string into lowercase in c++ ???

Free Discussion

At first you should take input . then you will convert it into lowercase. Its so easy..! string myinput_string; getline(cin,myinput_string); for(int i=1;i<myinput_string.length();i++) { myinput_string[i]=tolower(myinput_string[i]); } //ok now print the input as usual cout<<myinput_string; so the total sample program will be:
#inclue<bits/stdc++.h> using namespace std; int main() { string myinput_string; getline(cin,myinput_string); for(int i=1;i<myinput_string.length();i++) { myinput_string[i]=tolower(myinput_string[i]); } cout<<myinput_string; return 0; }

Quote: "My mission in life is not merely to survive, but to thrive; and to do so with some passion, some compassion, some humor, and some style..."