Hi, this is homework help I am seeking. I was able to convert a string of letter
ID: 3655776 • Letter: H
Question
Hi, this is homework help I am seeking. I was able to convert a string of letters to lowercase, but I don't know how to convert it back to uppercase. Please show me how. I obviously am learning but understand what I want and need, so please just give me the help I am asking for. I am on a time crunch and I've been working on this for days! I am really frustrated. Thank you for helping me. Here's what I have so far (using cctype): int main() { int i = 0; char ch; char str[]=" "; cout << "enter some letters" << endl; cin >> str; while (str[i]) { ch = str[i]; putchar (toupper(ch)); i++; } return 0; }Explanation / Answer
//if you can convert to lowercase, you should be able to convert upper case with // very little effort. The differnce between 'A' and 'a' is 32. 'A'+32='a' //or as you are using toupper(ch), its sister function is tolower(ch) #include using namespace std; int main() { int i = 0; char ch; char str[]=" "; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.