C++ String Exercises: Check whether a string is uppercase or lowercase
Write a C++ program to check if a given string contains only uppercase or only lowercase letters. Return "True" if the string is uppercase or lowercase, otherwise "False".
Sample Data:
("ABCDEF") -> “True”
("abcdef") -> “True”
("ABcDef") -> “False”
Sample Solution-1:
C++ Code:
Sample Output:
Original string: ABCDEF Check whether the said string is uppercase or lowercase: True
Flowchart:
Sample Solution-2:
C++ Code:
Sample Output:
Original string: ABcDef Check whether the said string is uppercase or lowercase: False
Flowchart:
C++ Code Editor:
Contribute your code and comments through Disqus.
Previous C++ Exercise: Identify the missing letter in a string.
Next C++ Exercise: Reverse the words of three or more lengths in a string.What is the difficulty level of this exercise?
Based on 2 votes, average difficulty level of this exercise is Medium
.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics