Answer to Question #173241 in C++ for Sridhar

Question #173241

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.


1
Expert's answer
2021-03-19T11:13:33-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS