C language: change the input letters into lowercase letters

A simple c
turns uppercase letters into lowercase letters, and the lowercase letters remain unchanged. Insert picture description here
Insert picture description here
For this we use the only trinocular operation in the C language, which is a judgment condition.
In the program, we define a character variable a, but we use it to compare with numbers. This is because the characters are stored in the form of ASCII codes in the computer, and the uppercase letters A to Z correspond to 65 to 90 of the ASCII code. , Lowercase letters are uppercase letters plus 32. In the figure, we can also use (a>='A'&&a<='Z') to replace the judgment in the figure, the effect is the same.

Guess you like

Origin blog.csdn.net/m0_52405419/article/details/115352306