Develop a C++ program for the person who wrongly filled the online application and help him to convert the input string to lowercase and uppercase.
#include <iostream>
#include <cctype>
#include <string>
#include <algorithm>
using namespace std;
//The start point of the program
int main (){
string inputString;
//get the number from the user
cout<<"Enter string : ";
getline(cin,inputString);
//display String in lowercase
cout<<"\nString in lowercase:\n";
//convert the input string to lowercase and uppercase.
transform(inputString.begin(), inputString.end(), inputString.begin(), ::tolower);
cout << inputString << endl;
//display String in UPPERCASE
cout<<"\nString in UPPERCASE:\n";
transform(inputString.begin(), inputString.end(), inputString.begin(), ::toupper);
cout << inputString << endl;
//delay
system("pause");
return 0;
}
Comments
Leave a comment