C++ Program to Convert Lowercase to Uppercase

To write a program to convert lowercase to uppercase or to convert uppercase to lowercase, we need to use the ASCII values of the letters. This can be an amazing beginner level project as a C++ programmer. If you want to know how to convert lowercase letters to uppercase or vice versa using C++, this article is for you. In this article, I will introduce you to a tutorial on how to write a C++ program to convert lowercase to uppercase of a letter and vice versa.

C++ Program to Convert Lowercase to Uppercase

To understand the logic behind converting a lowercase letter to uppercase or vice versa, you need to understand the full ASCII table. It stands for American Standard Code for Information Interchange. It is nothing more than a character encoding standard for electronic communications. Below is the full ASCII table that will help you understand the logic behind writing a program to convert lowercase to uppercase or vice versa.

Letter ASCII Code Binary Letter ASCII Code Binary
a971100001A651000001
b981100010B661000010
c991100011C671000011
d1001100100D681000100
e1011100101E691000101
f1021100110F701000110
g1031100111G711000111
h1041101000H721001000
i1051101001I731001001
j1061101010J741001010
k1071101011K751001011
l1081101100L761001100
m1091101101M771001101
n1101101110N781001110
o1111101111O791001111
p1121110000P801010000
q1131110001Q811010001
r1141110010R821010010
s1151110011S831010011
t1161110100T841010100
u1171110101U851010101
v1181110110V861010110
w1191110111W871010111
x1201111000X881011000
y1211111001Y891011001
z1221111010Z901011010

I hope you have understood the ASCII table shown above. The only things that you should take away from the above table for writing this program are:

  1. 65 to 90 = A to Z
  2. 97 to 122 = a to z

Now below is how you can write a C++ program to convert a letter with lowercase to uppercase or vice versa:

Summary

So this is how you can write a program for converting the lowercase of a letter to uppercase or vice versa by using the C++ programming language. This can be an amazing beginner level project as a C++ programmer. I hope you liked this article on how to write a C++ program to convert lowercase to uppercase or vice versa using C++. Feel free to ask your valuable questions in the comments section below.

Default image
Aman Kharwal
Coder with the ♥️ of a Writer || Data Scientist | Solopreneur | Founder
Articles: 1103

Leave a Reply