#include#include using namespace std; int main() { string myString = "Hello World!"; transform(myString.begin(), myString.end(), myString.begin(), ::tolower); cout << myString << endl; return 0; }
#includeThis code prompts the user for a string input, then uses transform() with the lowercase lambda operator (::tolower) on the userInput variable to output the lowercase version of the string. Package Library: Standard Library (included in C++)#include using namespace std; int main() { string userInput; cout << "Enter a string: "; getline(cin, userInput); transform(userInput.begin(), userInput.end(), userInput.begin(), ::tolower); cout << "Lowercase string: " << userInput << endl; return 0; }