Answer to Question #255463 in C++ for JacksonCrews

Question #255463

Use the functions char toUpper(char) to check if a char is a lowercase alphabetic value. If it is, return the uppercase equivalent. If it isn’t, return the original char.


1
Expert's answer
2021-10-23T08:06:08-0400
#include<iostream>
#include<string>
#include<ctype.h>
using namespace std;
char toUpper(char n){
	if(islower(n)){
		return toupper(n);
	}
	else{
		return n;
	}


}
int main(){
	cout<<"Enter a character:\n";
	char n;
	cin>>n;
cout<<toUpper(n)<<endl;
}

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