Convert lowercase to uppercase

You are given a single character ch.

  • If the character is a lowercase English letter (a to z), convert it to uppercase using ASCII logic.
  • Otherwise, return the character as it is.

Note: You must NOT use built-in functions like toupper().

Example 1:

Input: ch = 'a'

Output: A

Example 2:

Input: ch = '@'

Output: @

Now Your Turn!

Pick the correct output for the given input

Input: ch = 'z'

Still unsure what the problem is asking ?

Let’s go through a few more examples, step by step, to make it clearer.

Constraints:

  • Input is a single character
  • Character can be: lowercase or uppercase letter, digit, special character

Hints

0
class Solution {
public:
char toUpperCase(char ch) {
//your code goes here
}
};
Test Case

Input:

Ch