C# program to change the case of entered character
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to change the case of entered character is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created a class CaseDemo that contains the Main() method. In the Main() method, we read a character from the keyboard.
In the above code, we checked entered character is an uppercase character or not. Because the ASCII value of 'A' is 65 and the ASCII value of 'Z' is 90. Then here we converted the entered character into lowercase character.
In the above code, we checked entered character is a lowercase character or not. Because the ASCII value of 'a' is 97 and the ASCII value of 'z' is 122. Then here we converted the entered character into uppercase character.