Answer to Question #17597 in C++ for nwary

Question #17597
/*Write a program that will
1- read a lower case character letter from the user.
The program supposed to
2 - convert the input character to upper case and display both input and output characters.
3- The conversion from lower case should be done using a user-defined function called convChar().

Note: to convert a character from lower case to upper case you need to subtract 32.

*/
1
Expert's answer
2012-10-31T08:25:12-0400
#include <iostream>
#include <conio.h>
using namespace std;void convChar(char ch){
cout<<"Enteredchar: " << ch << endl;
cout<<"Convertedchar: " << ch-32 << endl;
}
int main ()
{
charch;
cout<<"entera character"<<endl;
cin>>ch;
convChar(ch);
system("pause");
return0;
}

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