124k views
2 votes
Write a program that converts the lowercase letter into uppercase letter. Use the following prototype:

a. char lowertoupper(char ch);
b. void lowertoupper(char ch);

User Lanrat
by
8.0k points

1 Answer

5 votes

Final answer:

To convert a lowercase letter to uppercase in C++, use the 'toupper' function with 'cctype' library.

Step-by-step explanation:

To convert a lowercase letter to an uppercase letter, you can use the 'toupper' function in C++. First, include the 'cctype' library. Then, declare a character variable 'ch' to store the lowercase letter. Finally, use 'toupper(ch)' to convert 'ch' to uppercase. Here's an example:

#include <cctype>

char lowertoupper(char ch) {
return toupper(ch);
}

void lowertoupper(char ch) {
ch = toupper(ch);
}

User NickLamp
by
8.4k points