Given a character, the task is to check whether the given character is in upper case, lower case, or non-alphabetic character Approach: The key to solving this problem lies in the ASCII value of a character. It is the simplest way to find out about a character. This problem is solved with the help of the following detail:
OutputA is an UpperCase character a is an LowerCase character 0 is not an aplhabetic character Time Complexity: O(1) as it is doing constant operations islower() – check whether a character is lowercase. isupper() – check whether a character is uppercase. Below is the implementation of the above approach.
OutputA is an UpperCase character a is an LowerCase character 0 is not an aplhabetic character Time Complexity: O(1) |